Skip to content

Commit

Permalink
Merge pull request #196 from StatTag/husky-upgrade
Browse files Browse the repository at this point in the history
Re-enable husky pre-commit hook
  • Loading branch information
lrasmus authored Aug 30, 2024
2 parents 1c37bb2 + 7fd7369 commit f73de56
Show file tree
Hide file tree
Showing 7 changed files with 560 additions and 289 deletions.
56 changes: 0 additions & 56 deletions .eslintignore

This file was deleted.

29 changes: 0 additions & 29 deletions .eslintrc.js

This file was deleted.

1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
4 changes: 2 additions & 2 deletions app/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export default class MenuBuilder {
{
label: 'Documentation',
click() {
shell.openExternal('https://sites.northwestern.edu/stattag/');
shell.openExternal('https://sites.northwestern.edu/statwrap/');
}
},
{
Expand Down Expand Up @@ -232,7 +232,7 @@ export default class MenuBuilder {
{
label: 'Documentation',
click() {
shell.openExternal('https://sites.northwestern.edu/stattag/');
shell.openExternal('https://sites.northwestern.edu/statwrap/');
}
},
{
Expand Down
96 changes: 96 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
const importPlugin = require("eslint-plugin-import");
const react = require('eslint-plugin-react');
const jest = require('eslint-plugin-jest');
const babelParser = require('@babel/eslint-parser');


module.exports = {
languageOptions: {
parser: babelParser,
},
plugins: { import: importPlugin, react, jest },
rules: {
'react/destructuring-assignment': 0,
'class-methods-use-this': 0,
'no-plusplus': 0,
'no-console': 0,
'no-param-reassign': ['error', { props: false }],
'import/no-extraneous-dependencies': ['error', { packageDir: __dirname }],
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
'react-hooks/rules-of-hooks': 0,
'react/prefer-stateless-function': 0,
'react/forbid-prop-types': 0,
'react/no-children-prop': 0,
'no-nested-ternary': 0,
'prefer-regex-literals': 0,
'jest/no-commented-out-tests': 0,
'jest/no-standalone-expect': 0,
'jest/expect-expect': 0,
'no-unused-vars': 0,
},
settings: {
'import/resolver': {
webpack: {
config: require.resolve('./configs/webpack.config.eslint.js'),
},
},
},
ignores: [
// Logs
'logs',
'*.log',

// Runtime data
'pids',
'*.pid',
'*.seed',

// Directory for instrumented libs generated by jscoverage/JSCover
'lib-cov',

// Coverage directory used by tools like istanbul
'coverage',

// Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
'.grunt',

// node-waf configuration
'.lock-wscript',

// Compiled binary addons (http://nodejs.org/api/addons.html)
'build/Release',
'.eslintcache',

// Dependency directory
// https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
'node_modules',

// OSX
'.DS_Store',

// flow-typed
'flow-typed/npm/*',
'!flow-typed/npm/module_vx.x.x.js',

// App packaged
'release',
'app/main.prod.js',
'app/main.prod.js.map',
'app/renderer.prod.js',
'app/renderer.prod.js.map',
'app/style.css',
'app/style.css.map',
'dist',
'dll',
'main.js',
'main.js.map',

'.idea',
'npm-debug.log.*',
'__snapshots__',

// Package.json
'package.json',
'.travis.yml'
]
};
82 changes: 22 additions & 60 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,19 @@
"test-all": "yarn lint && && yarn build && yarn test && yarn build-e2e && yarn test-e2e",
"test-e2e": "node -r @babel/register ./internals/scripts/CheckBuildsExist.js && cross-env NODE_ENV=test testcafe electron:./app ./test/e2e/HomePage.e2e.js",
"test-e2e-live": "node -r @babel/register ./internals/scripts/CheckBuildsExist.js && cross-env NODE_ENV=test testcafe --live electron:./app ./test/e2e/HomePage.e2e.js",
"test-watch": "yarn test --watch"
"test-watch": "yarn test --watch",
"prepare": "husky"
},
"lint-staged": {
"*.{js,jsx}": [
"cross-env NODE_ENV=development eslint --cache --format=pretty",
"git add"
],
"*.{js,jsx}": ["cross-env NODE_ENV=development eslint --cache --format=pretty"],
"{*.json,.{babelrc,eslintrc,prettierrc,stylelintrc}}": [
"prettier --ignore-path .eslintignore --parser json --write",
"git add"
"prettier --ignore-path .eslintignore --parser json --write"
],
"*.{css,scss}": [
"stylelint --ignore-path .eslintignore --fix",
"prettier --ignore-path .eslintignore --single-quote --write",
"git add"
"prettier --ignore-path .eslintignore --single-quote --write"
],
"*.{html,md,yml}": [
"prettier --ignore-path .eslintignore --single-quote --write",
"git add"
]
"*.{html,md,yml}": ["prettier --ignore-path .eslintignore --single-quote --write"]
},
"build": {
"productName": "StatWrap",
Expand Down Expand Up @@ -87,17 +80,10 @@
]
},
"win": {
"target": [
"nsis",
"msi"
]
"target": ["nsis", "msi"]
},
"linux": {
"target": [
"deb",
"rpm",
"AppImage"
],
"target": ["deb", "rpm", "AppImage"],
"category": "Development"
},
"directories": {
Expand All @@ -124,46 +110,27 @@
"bugs": {
"url": "https://github.com/StatTag/StatWrap/issues"
},
"keywords": [
"electron",
"boilerplate",
"react",
"sass",
"webpack",
"hot",
"reload"
],
"keywords": ["electron", "boilerplate", "react", "sass", "webpack", "hot", "reload"],
"homepage": "http://stattag.org",
"jest": {
"testEnvironmentOptions": {
"url": "http://localhost/"
},
"setupFilesAfterEnv": [
"jest-os-detection",
"jest-extended/all"
],
"setupFilesAfterEnv": ["jest-os-detection", "jest-extended/all"],
"moduleNameMapper": {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/internals/mocks/fileMock.js",
"\\.(css|less|sass|scss)$": "identity-obj-proxy"
},
"moduleFileExtensions": [
"js",
"jsx",
"json"
],
"moduleDirectories": [
"node_modules",
"app/node_modules"
],
"moduleFileExtensions": ["js", "jsx", "json"],
"moduleDirectories": ["node_modules", "app/node_modules"],
"transform": {
"^.+\\.jsx?$": "babel-jest"
},
"setupFiles": [
"./internals/scripts/CheckBuildsExist.js"
]
"setupFiles": ["./internals/scripts/CheckBuildsExist.js"]
},
"devDependencies": {
"@babel/core": "^7.24.4",
"@babel/eslint-parser": "^7.25.1",
"@babel/plugin-proposal-class-properties": "^7.7.4",
"@babel/plugin-proposal-decorators": "^7.24.1",
"@babel/plugin-proposal-do-expressions": "^7.24.1",
Expand Down Expand Up @@ -212,17 +179,17 @@
"eslint-config-prettier": "^9.1.0",
"eslint-formatter-pretty": "^6.0.1",
"eslint-import-resolver-webpack": "^0.13.8",
"eslint-plugin-compat": "^4.2.0",
"eslint-plugin-compat": "^6.0.0",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^28.2.0",
"eslint-plugin-jsx-a11y": "6.8.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-jest": "^28.8.0",
"eslint-plugin-jsx-a11y": "6.9.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-promise": "^7.1.0",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-testcafe": "^0.2.1",
"file-loader": "6.2.0",
"husky": "^9.0.11",
"husky": "^9.1.5",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.7.0",
"lint-staged": "^15.2.2",
Expand Down Expand Up @@ -315,10 +282,5 @@
"npm": ">=8.x",
"yarn": ">=1.20.x"
},
"browserslist": "electron 1.6",
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
"browserslist": "electron 1.6"
}
Loading

0 comments on commit f73de56

Please sign in to comment.