-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
11 changed files
with
10,405 additions
and
5,551 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
"use strict"; | ||
|
||
module.exports = { | ||
root: true, | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:eslint-plugin/recommended", | ||
"plugin:node/recommended", | ||
], | ||
env: { | ||
node: 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
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,2 +1,6 @@ | ||
# registry=https://registry.npmjs.org/ | ||
# @eyea:registry=https://npm.pkg.github.com | ||
|
||
//registry.npmjs.org/:_authToken=${AFUTEAM_LINT_PUBLISH_NPM_TOKEN} | ||
registry=https://registry.npmjs.org/ | ||
@eyea:registry=https://npm.pkg.github.com | ||
always-auth=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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Basic: Eslint/JavaScript Version: 1.0.0 | ||
|
||
module.exports = { | ||
env: { | ||
browser: true, | ||
commonjs: true, | ||
es6: true, | ||
node: true, | ||
es2021: true, | ||
}, | ||
globals: { | ||
AHAPP: 'readonly', | ||
AHJavascriptBridge: 'readonly', | ||
trackPageView: 'readonly', | ||
trackCustomEvent: 'readonly', | ||
Atomics: 'readonly', | ||
SharedArrayBuffer: 'readonly', | ||
}, | ||
// 继承的规则 [扩展] | ||
extends: [ | ||
'eslint:recommended' | ||
], | ||
parserOptions: { | ||
ecmaVersion: 2021, | ||
sourceType: 'module', | ||
}, | ||
ignorePatterns: ['*.min.*'], | ||
rules: { | ||
// JavaScript Basic rules, 35条 使用afu的rules,和eslint/recommended搭配 | ||
'no-multi-spaces': 2, | ||
'no-unused-vars': 1, // 非TS项目,此项需设为1 | ||
'no-undef': 0, | ||
'no-empty-function': 2, | ||
'no-shadow': 2, | ||
'curly': 2, | ||
'array-callback-return': 2, | ||
'block-scoped-var': 2, | ||
'default-case': 2, | ||
'complexity': ['error', { 'max': 20 }], | ||
'no-console': 0, | ||
'no-await-in-loop': 2, | ||
'no-mixed-spaces-and-tabs': 0, | ||
'no-prototype-builtins': 0, | ||
'no-useless-escape': 0, | ||
'no-self-assign': 0, | ||
'no-caller': 2, | ||
'no-div-regex': 2, | ||
'no-floating-decimal': 2, | ||
'no-new-wrappers': 2, | ||
'no-return-assign': 2, | ||
'no-unmodified-loop-condition': 2, | ||
'require-await': 2, | ||
'wrap-iife': 1, | ||
'require-atomic-updates': 2, | ||
'no-empty': 2, | ||
'no-case-declarations': 2, | ||
// 追加的几条规则 | ||
'no-use-before-define': 0, // 未定义前不能使用 | ||
'no-new': 0, | ||
'new-cap': 0, | ||
'global-require': 0, | ||
'consistent-return': 0, // return 后面是否允许省略 | ||
'no-underscore-dangle': 0, // 标识符不能以_开头或结尾;如果使用react的规则的话,我们有这个规则 | ||
'no-unused-expressions': 1, // 禁止无用的表达式 | ||
}, | ||
} |
Oops, something went wrong.