-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
52eac90
commit f3ee9c6
Showing
14 changed files
with
584 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
module.exports = { | ||
parser: "babel-eslint", | ||
parserOptions: { | ||
sourceType: "module", // 设置为 "script" (默认) 或 "module"(ES6)。 | ||
ecmaFeatures: { | ||
// 这是个对象,表示你想使用的额外的语言特性: | ||
jsx: true, // 启用 JSX | ||
globalReturn: true, | ||
impliedStrict: true, | ||
ecmaVersion: 6, | ||
}, | ||
}, | ||
env: { | ||
browser: true, | ||
node: true, | ||
}, | ||
extends: [ | ||
"airbnb", | ||
"eslint:recommended", | ||
"plugin:import/errors", | ||
"plugin:jsx-a11y/recommended", | ||
"plugin:prettier/recommended", | ||
"plugin:react/recommended", | ||
], | ||
plugins: [ | ||
// 'react-hooks', | ||
], | ||
globals: { | ||
// 允许在代码中使用全局变量 | ||
location: true, | ||
setTimeout: true, | ||
}, | ||
rules: { | ||
"no-unused-vars": 1, | ||
}, | ||
}; | ||
// module.exports = { | ||
// parser: "babel-eslint", | ||
// parserOptions: { | ||
// sourceType: "module", // 设置为 "script" (默认) 或 "module"(ES6)。 | ||
// ecmaFeatures: { | ||
// // 这是个对象,表示你想使用的额外的语言特性: | ||
// jsx: true, // 启用 JSX | ||
// globalReturn: true, | ||
// impliedStrict: true, | ||
// ecmaVersion: 6, | ||
// }, | ||
// }, | ||
// env: { | ||
// browser: true, | ||
// node: true, | ||
// }, | ||
// extends: [ | ||
// "airbnb", | ||
// "eslint:recommended", | ||
// "plugin:import/errors", | ||
// "plugin:jsx-a11y/recommended", | ||
// "plugin:prettier/recommended", | ||
// "plugin:react/recommended", | ||
// ], | ||
// plugins: [ | ||
// // 'react-hooks', | ||
// ], | ||
// globals: { | ||
// // 允许在代码中使用全局变量 | ||
// location: true, | ||
// setTimeout: true, | ||
// }, | ||
// rules: { | ||
// "no-unused-vars": 1, | ||
// }, | ||
// }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
const a = 10; | ||
// const a = 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module.exports = { | ||
parserOptions: { | ||
ecmaFeatures: { | ||
globalReturn: true, | ||
impliedStrict: true, | ||
}, | ||
requireConfigFile: false, | ||
allowImportExportEverywhere: false, | ||
}, | ||
env: { | ||
browser: true, | ||
}, | ||
globals: { | ||
__CLIENT__: true, | ||
__SERVER__: true, | ||
__DEVELOPMENT__: true, | ||
__DEBUG__: true, | ||
__DEVTOOLS__: true, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
const eslintrc = require("./.eslintrc.js"); | ||
// const eslintrc = require("./.eslintrc.js"); | ||
|
||
module.exports = eslintrc; | ||
// module.exports = eslintrc; | ||
|
||
module.exports = { | ||
extends: [ | ||
"./configs/base", | ||
"eslint-config-airbnb-base", | ||
"./rules/es", | ||
"./rules/import", | ||
].map(require.resolve), | ||
parser: "babel-eslint", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
extends: [ | ||
"./configs/base", | ||
"eslint-config-airbnb", | ||
"./rules/es", | ||
"./rules/import", | ||
"./rules/jsx-a11y", | ||
"./rules/react", | ||
].map(require.resolve), | ||
parser: "babel-eslint", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
module.exports = { | ||
plugins: ['babel'], | ||
rules: { | ||
'linebreak-style': 'off', | ||
'func-names': ['error', 'as-needed'], | ||
'prefer-arrow-callback': 'warn', | ||
// 允许连续赋值 | ||
'no-multi-assign': 'off', | ||
// 不禁止对函数的参数重新赋值 | ||
'no-param-reassign': 'off', | ||
'no-unused-expressions': [ | ||
'error', | ||
{ | ||
allowShortCircuit: true, | ||
allowTernary: true, | ||
allowTaggedTemplates: true, | ||
}, | ||
], | ||
'consistent-return': 'off', | ||
'no-unused-vars': [ | ||
'warn', | ||
{ | ||
vars: 'all', | ||
args: 'after-used', | ||
caughtErrors: 'none', | ||
ignoreRestSiblings: true, | ||
}, | ||
], | ||
'global-require': 'off', | ||
'max-len': 'off', | ||
'no-console': [ | ||
'warn', | ||
{ | ||
allow: ['debug', 'info', 'warn', 'error'], | ||
}, | ||
], | ||
'no-bitwise': [ | ||
'error', | ||
{ | ||
allow: ['~'], | ||
}, | ||
], | ||
'no-underscore-dangle': 'off', | ||
'arrow-body-style': 'off', | ||
'default-case': 'off', | ||
// 函数也需要多行尾逗号 | ||
'comma-dangle': [ | ||
'error', | ||
{ | ||
arrays: 'always-multiline', | ||
objects: 'always-multiline', | ||
imports: 'always-multiline', | ||
exports: 'always-multiline', | ||
functions: 'always-multiline', | ||
}, | ||
], | ||
eqeqeq: [ | ||
'warn', | ||
'always', | ||
{ | ||
null: 'ignore', | ||
}, | ||
], | ||
'no-plusplus': [ | ||
'error', | ||
{ | ||
allowForLoopAfterthoughts: true, | ||
}, | ||
], | ||
'no-multi-spaces': [ | ||
'error', | ||
{ | ||
ignoreEOLComments: true, | ||
// exceptions: { | ||
// Property: true, | ||
// BinaryExpression: false, | ||
// VariableDeclarator: true, | ||
// ImportDeclaration: true, | ||
// }, | ||
}, | ||
], | ||
'object-curly-newline': [ | ||
'error', | ||
{ | ||
multiline: true, | ||
consistent: true, | ||
}, | ||
], | ||
// 使用 babel/semi,实例属性需要加分号 | ||
semi: 'off', | ||
'babel/semi': ['error', 'always'], | ||
// 强制三元运算符格式 | ||
'multiline-ternary': ['error', 'always-multiline'], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
rules: { | ||
"import/no-extraneous-dependencies": "off", | ||
"import/no-unresolved": "off", | ||
"import/extensions": "off", | ||
"import/prefer-default-export": "warn", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module.exports = { | ||
rules: { | ||
"jsx-a11y/no-static-element-interactions": "off", | ||
"jsx-a11y/no-noninteractive-element-interactions": "off", | ||
"jsx-a11y/anchor-is-valid": [ | ||
"error", | ||
{ | ||
components: ["Link"], | ||
specialLink: ["to"], | ||
aspects: ["noHref", "invalidHref", "preferButton"], | ||
}, | ||
], | ||
"jsx-a11y/click-events-have-key-events": "off", | ||
"jsx-a11y/label-has-for": "off", | ||
"jsx-a11y/label-has-associated-control": "off", | ||
}, | ||
}; |
Oops, something went wrong.