mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-02 12:52:38 +00:00
Merge pull request #3663 from naturalcrit/updateEsLintV9
up ESLint to v9.9
This commit is contained in:
79
.eslintrc.js
79
.eslintrc.js
@@ -1,79 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
root : true,
|
|
||||||
parserOptions : {
|
|
||||||
ecmaVersion : 2021,
|
|
||||||
sourceType : 'module',
|
|
||||||
ecmaFeatures : {
|
|
||||||
jsx : true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
env : {
|
|
||||||
browser : true,
|
|
||||||
node : true
|
|
||||||
},
|
|
||||||
plugins : ['react', 'jest'],
|
|
||||||
rules : {
|
|
||||||
/** Errors **/
|
|
||||||
'camelcase' : ['error', { properties: 'never' }],
|
|
||||||
//'func-style' : ['error', 'expression', { allowArrowFunctions: true }],
|
|
||||||
'no-array-constructor' : 'error',
|
|
||||||
'no-iterator' : 'error',
|
|
||||||
'no-nested-ternary' : 'error',
|
|
||||||
'no-new-object' : 'error',
|
|
||||||
'no-proto' : 'error',
|
|
||||||
'react/jsx-no-bind' : ['error', { allowArrowFunctions: true }],
|
|
||||||
'react/jsx-uses-react' : 'error',
|
|
||||||
'react/prefer-es6-class' : ['error', 'never'],
|
|
||||||
'jest/valid-expect' : ['error', { maxArgs: 3 }],
|
|
||||||
|
|
||||||
/** Warnings **/
|
|
||||||
'max-lines' : ['warn', {
|
|
||||||
max : 200,
|
|
||||||
skipComments : true,
|
|
||||||
skipBlankLines : true,
|
|
||||||
}],
|
|
||||||
'max-depth' : ['warn', { max: 4 }],
|
|
||||||
'max-params' : ['warn', { max: 5 }],
|
|
||||||
'no-restricted-syntax' : ['warn', 'ClassDeclaration', 'SwitchStatement'],
|
|
||||||
'no-unused-vars' : ['warn', {
|
|
||||||
vars : 'all',
|
|
||||||
args : 'none',
|
|
||||||
varsIgnorePattern : 'config|_|cx|createClass'
|
|
||||||
}],
|
|
||||||
'react/jsx-uses-vars' : 'warn',
|
|
||||||
|
|
||||||
/** Fixable **/
|
|
||||||
'arrow-parens' : ['warn', 'always'],
|
|
||||||
'brace-style' : ['warn', '1tbs', { allowSingleLine: true }],
|
|
||||||
'jsx-quotes' : ['warn', 'prefer-single'],
|
|
||||||
'no-var' : 'warn',
|
|
||||||
'prefer-const' : 'warn',
|
|
||||||
'prefer-template' : 'warn',
|
|
||||||
'quotes' : ['warn', 'single', { 'allowTemplateLiterals': true }],
|
|
||||||
'semi' : ['warn', 'always'],
|
|
||||||
|
|
||||||
/** Whitespace **/
|
|
||||||
'array-bracket-spacing' : ['warn', 'never'],
|
|
||||||
'arrow-spacing' : ['warn', { before: false, after: false }],
|
|
||||||
'comma-spacing' : ['warn', { before: false, after: true }],
|
|
||||||
'indent' : ['warn', 'tab', { 'MemberExpression': 'off' }],
|
|
||||||
'keyword-spacing' : ['warn', {
|
|
||||||
before : true,
|
|
||||||
after : true,
|
|
||||||
overrides : {
|
|
||||||
if : { 'before': false, 'after': false }
|
|
||||||
}
|
|
||||||
}],
|
|
||||||
'key-spacing' : ['warn', {
|
|
||||||
multiLine : { beforeColon: true, afterColon: true, align: 'colon' },
|
|
||||||
singleLine : { beforeColon: false, afterColon: true }
|
|
||||||
}],
|
|
||||||
'linebreak-style' : 'off',
|
|
||||||
'no-trailing-spaces' : 'warn',
|
|
||||||
'no-whitespace-before-property' : 'warn',
|
|
||||||
'object-curly-spacing' : ['warn', 'always'],
|
|
||||||
'react/jsx-indent-props' : ['warn', 'tab'],
|
|
||||||
'space-in-parens' : ['warn', 'never'],
|
|
||||||
'template-curly-spacing' : ['warn', 'never'],
|
|
||||||
}
|
|
||||||
};
|
|
||||||
71
eslint.config.mjs
Normal file
71
eslint.config.mjs
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
import react from "eslint-plugin-react";
|
||||||
|
import jest from "eslint-plugin-jest";
|
||||||
|
import globals from "globals";
|
||||||
|
|
||||||
|
export default [{
|
||||||
|
ignores: ["build/"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files : ['**/*.js', '**/*.jsx'],
|
||||||
|
plugins : { react, jest },
|
||||||
|
languageOptions : {
|
||||||
|
ecmaVersion : "latest",
|
||||||
|
sourceType : "module",
|
||||||
|
parserOptions : { ecmaFeatures: { jsx: true } },
|
||||||
|
globals : { ...globals.browser, ...globals.node }
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
/** Errors **/
|
||||||
|
"camelcase" : ["error", { properties: "never" }],
|
||||||
|
"no-array-constructor" : "error",
|
||||||
|
"no-iterator" : "error",
|
||||||
|
"no-nested-ternary" : "error",
|
||||||
|
"no-new-object" : "error",
|
||||||
|
"no-proto" : "error",
|
||||||
|
"react/jsx-no-bind" : ["error", { allowArrowFunctions: true }],
|
||||||
|
"react/jsx-uses-react" : "error",
|
||||||
|
"react/prefer-es6-class" : ["error", "never"],
|
||||||
|
"jest/valid-expect" : ["error", { maxArgs: 3 }],
|
||||||
|
|
||||||
|
/** Warnings **/
|
||||||
|
"max-lines" : ["warn", { max: 200, skipComments: true, skipBlankLines: true }],
|
||||||
|
"max-depth" : ["warn", { max: 4 }],
|
||||||
|
"max-params" : ["warn", { max: 5 }],
|
||||||
|
"no-restricted-syntax" : ["warn", "ClassDeclaration", "SwitchStatement"],
|
||||||
|
"no-unused-vars" : ["warn", { vars: "all", args: "none", varsIgnorePattern: "config|_|cx|createClass" }],
|
||||||
|
"react/jsx-uses-vars" : "warn",
|
||||||
|
|
||||||
|
/** Fixable **/
|
||||||
|
"arrow-parens" : ["warn", "always"],
|
||||||
|
"brace-style" : ["warn", "1tbs", { allowSingleLine: true }],
|
||||||
|
"jsx-quotes" : ["warn", "prefer-single"],
|
||||||
|
"no-var" : "warn",
|
||||||
|
"prefer-const" : "warn",
|
||||||
|
"prefer-template" : "warn",
|
||||||
|
"quotes" : ["warn", "single", { allowTemplateLiterals: true }],
|
||||||
|
"semi" : ["warn", "always"],
|
||||||
|
|
||||||
|
/** Whitespace **/
|
||||||
|
"array-bracket-spacing" : ["warn", "never"],
|
||||||
|
"arrow-spacing" : ["warn", { before: false, after: false }],
|
||||||
|
"comma-spacing" : ["warn", { before: false, after: true }],
|
||||||
|
"indent" : ["warn", "tab", { MemberExpression: "off" }],
|
||||||
|
"linebreak-style" : "off",
|
||||||
|
"no-trailing-spaces" : "warn",
|
||||||
|
"no-whitespace-before-property" : "warn",
|
||||||
|
"object-curly-spacing" : ["warn", "always"],
|
||||||
|
"react/jsx-indent-props" : ["warn", "tab"],
|
||||||
|
"space-in-parens" : ["warn", "never"],
|
||||||
|
"template-curly-spacing" : ["warn", "never"],
|
||||||
|
"keyword-spacing" : ["warn", {
|
||||||
|
before : true,
|
||||||
|
after : true,
|
||||||
|
overrides : { if: { before: false, after: false } }
|
||||||
|
}],
|
||||||
|
"key-spacing" : ["warn", {
|
||||||
|
multiLine : { beforeColon: true, afterColon: true, align: "colon" },
|
||||||
|
singleLine : { beforeColon: false, afterColon: true }
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
];
|
||||||
30906
package-lock.json
generated
30906
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -15,8 +15,8 @@
|
|||||||
"quick": "node scripts/quick.js",
|
"quick": "node scripts/quick.js",
|
||||||
"build": "node scripts/buildHomebrew.js && node scripts/buildAdmin.js",
|
"build": "node scripts/buildHomebrew.js && node scripts/buildAdmin.js",
|
||||||
"builddev": "node scripts/buildHomebrew.js --dev",
|
"builddev": "node scripts/buildHomebrew.js --dev",
|
||||||
"lint": "eslint --fix **/*.{js,jsx}",
|
"lint": "eslint --fix",
|
||||||
"lint:dry": "eslint **/*.{js,jsx}",
|
"lint:dry": "eslint",
|
||||||
"stylelint": "stylelint --fix **/*.{less}",
|
"stylelint": "stylelint --fix **/*.{less}",
|
||||||
"stylelint:dry": "stylelint **/*.less",
|
"stylelint:dry": "stylelint **/*.less",
|
||||||
"circleci": "npm test && eslint **/*.{js,jsx} --max-warnings=0",
|
"circleci": "npm test && eslint **/*.{js,jsx} --max-warnings=0",
|
||||||
@@ -125,9 +125,10 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@stylistic/stylelint-plugin": "^3.0.1",
|
"@stylistic/stylelint-plugin": "^3.0.1",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^9.9.0",
|
||||||
"eslint-plugin-jest": "^28.8.0",
|
"eslint-plugin-jest": "^28.8.0",
|
||||||
"eslint-plugin-react": "^7.35.0",
|
"eslint-plugin-react": "^7.35.0",
|
||||||
|
"globals": "^15.9.0",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"jest-expect-message": "^1.1.3",
|
"jest-expect-message": "^1.1.3",
|
||||||
"postcss-less": "^6.0.0",
|
"postcss-less": "^6.0.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user