-
Notifications
You must be signed in to change notification settings - Fork 11
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
5 changed files
with
968 additions
and
3 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,5 @@ | ||
dist/ | ||
lib/ | ||
node_modules/ | ||
public/ | ||
config/ |
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,63 @@ | ||
const eslintrc = { | ||
parser: '@typescript-eslint/parser', | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
], | ||
plugins: [ | ||
'@typescript-eslint', | ||
], | ||
env: { | ||
browser: true, | ||
node: true, | ||
es6: true, | ||
}, | ||
parserOptions: { | ||
project: './tsconfig.eslint.json', | ||
ecmaVersion: 2019, | ||
sourceType: 'module', | ||
ecmaFeatures: { | ||
experimentalObjectRestSpread: true | ||
} | ||
}, | ||
rules: { | ||
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules | ||
'@typescript-eslint/consistent-type-definitions': 0, | ||
'@typescript-eslint/explicit-function-return-type': 0, | ||
'@typescript-eslint/generic-type-naming': 0, | ||
'@typescript-eslint/indent': ['error', 2], | ||
'@typescript-eslint/member-ordering': 0, | ||
'@typescript-eslint/no-explicit-any': 0, | ||
'@typescript-eslint/no-extra-parens': 0, | ||
'@typescript-eslint/no-magic-numbers': 0, | ||
'@typescript-eslint/no-parameter-properties': 0, | ||
'@typescript-eslint/no-type-alias': 0, | ||
'@typescript-eslint/no-use-before-define': 0, | ||
'@typescript-eslint/prefer-for-of': 1, | ||
'@typescript-eslint/prefer-interface': 0, | ||
'@typescript-eslint/interface-name-prefix': [0, { | ||
prefixWithI: 'always' | ||
}], // 接口名称首字母 I | ||
'@typescript-eslint/member-delimiter-style': [0, { | ||
delimiter: 'none' | ||
}], // 成员分隔符 | ||
'@typescript-eslint/semi': ['error', 'never'], | ||
|
||
'space-infix-ops': ['error'], | ||
'comma-dangle': ['error', { | ||
'arrays': 'always-multiline', | ||
'objects': 'always-multiline', | ||
'imports': 'always-multiline', | ||
'exports': 'always-multiline', | ||
'functions': 'never' | ||
}], | ||
'space-before-function-paren': ['error', 'always'], // 方法名后空格 | ||
'semi': ['error', 'never'], // 无分号 | ||
'indent': ['error', 2], // 缩进2 | ||
'quotes': ['error', 'single'], // 单引号 | ||
'no-param-reassign': 0, // 传入参数可修改 | ||
'no-restricted-globals': ['error', 'event'] // 部分全局变量禁止直接使用 | ||
}, | ||
} | ||
|
||
module.exports = eslintrc |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"resolveJsonModule": true, | ||
}, | ||
"include": [ | ||
"**/*.ts", | ||
"**/*.js" | ||
] | ||
} |
Oops, something went wrong.