Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
hemengke1997 committed Jan 6, 2022
2 parents 51146ca + a2163f2 commit fa92946
Show file tree
Hide file tree
Showing 33 changed files with 3,766 additions and 6,936 deletions.
206 changes: 193 additions & 13 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,194 @@
// 0 = off, 1 = warn, 2 = error
module.exports = {
extends: [require.resolve("@umijs/fabric/dist/eslint")],
const { defineConfig } = require('eslint-define-config');

module.exports = defineConfig({
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
parser: '@typescript-eslint/parser',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
requireConfigFile: false,
},
extends: ['plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended', 'prettier'],
plugins: ['prettier'],
env: {
browser: true,
node: true,
es6: true,
},
// "off" or 0 - turn the rule off
// "warn" or 1 - turn the rule on as a warning (doesn't affect exit code)
// "error" or 2 - turn the rule on as an error (exit code will be 1)
rules: {
"symbol-description": 0,
"@typescript-eslint/no-shadow": 0,
"no-return-assign": 0,
"react/jsx-uses-react": 1,
"react/jsx-no-undef": 2,
"react/jsx-wrap-multilines": 2,
"react/no-string-refs": 0,
"no-plusplus": 0
},
};
'prettier/prettier': 'warn',
'no-undef': 0,
'@typescript-eslint/adjacent-overload-signatures': 0,
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/await-thenable': 0,
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/ban-tslint-comment': 0,
'brace-style': 'off',
'@typescript-eslint/brace-style': 0,
'@typescript-eslint/class-literal-property-style': 0,
'comma-dangle': 'off',
'@typescript-eslint/comma-dangle': 0,
'comma-spacing': 'off',
'@typescript-eslint/comma-spacing': 0,
'@typescript-eslint/consistent-indexed-object-style': 0,
'@typescript-eslint/consistent-type-assertions': 0,
'@typescript-eslint/consistent-type-definitions': 0,
'@typescript-eslint/consistent-type-imports': 1,
'default-param-last': 'off',
'@typescript-eslint/default-param-last': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'func-call-spacing': 'off',
'@typescript-eslint/consistent-type-imports': 'off',
'@typescript-eslint/func-call-spacing': 0,
indent: 'off',
'init-declarations': 'off',
'@typescript-eslint/init-declarations': 0,
'keyword-spacing': 'off',
'@typescript-eslint/keyword-spacing': 0,
'lines-between-class-members': 'off',
'@typescript-eslint/lines-between-class-members': 0,
'@typescript-eslint/member-delimiter-style': 0,
'@typescript-eslint/member-ordering': 0,
'@typescript-eslint/method-signature-style': 'error',
'no-array-constructor': 'off',
'prefer-const': 'off',
'@typescript-eslint/no-array-constructor': 0,
'@typescript-eslint/no-base-to-string': 0,
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
'@typescript-eslint/no-confusing-void-expression': 0,
'no-dupe-class-members': 'off',
'@typescript-eslint/no-dupe-class-members': 'error',
'no-duplicate-imports': 'off',
'@typescript-eslint/no-duplicate-imports': 0,
'@typescript-eslint/no-dynamic-delete': 0,
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/no-empty-interface': 1,
'@typescript-eslint/no-extra-non-null-assertion': 0,
'no-extra-parens': 'off',
'@typescript-eslint/no-extra-parens': 0,
'no-extra-semi': 'off',
'@typescript-eslint/no-extra-semi': 0,
'@typescript-eslint/no-extraneous-class': 0,
'@typescript-eslint/no-floating-promises': 0,
'@typescript-eslint/no-implicit-any-catch': 0,
'no-implied-eval': 'off',
'@typescript-eslint/no-implied-eval': 0,
'@typescript-eslint/no-inferrable-types': 0,
'no-invalid-this': 'off',
'@typescript-eslint/no-invalid-this': 'error',
'@typescript-eslint/no-invalid-void-type': 0,
'no-loop-func': 'off',
'@typescript-eslint/no-loop-func': 'error',
'no-loss-of-precision': 'off',
'@typescript-eslint/no-loss-of-precision': 0,
'no-magic-numbers': 'off',
'@typescript-eslint/no-magic-numbers': 0,
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-misused-promises': 0,
'@typescript-eslint/no-namespace': 1,
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
'@typescript-eslint/no-parameter-properties': 'error',
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': 'error',
'@typescript-eslint/no-require-imports': 0,
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/no-this-alias': 'error',
'no-throw-literal': 'off',
'@typescript-eslint/no-type-alias': 0,
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 0,
'@typescript-eslint/no-unnecessary-condition': 0,
'@typescript-eslint/no-unnecessary-qualifier': 0,
'@typescript-eslint/no-unnecessary-type-arguments': 0,
'@typescript-eslint/no-unnecessary-type-assertion': 0,
'@typescript-eslint/no-unnecessary-type-constraint': 0,
'@typescript-eslint/no-unsafe-assignment': 0,
'@typescript-eslint/no-unsafe-call': 0,
'@typescript-eslint/no-unsafe-member-access': 0,
'@typescript-eslint/no-unsafe-return': 0,
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'no-use-before-define': 'off',
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': 'error',
'@typescript-eslint/non-nullable-type-assertion-style': 0,
'@typescript-eslint/prefer-as-const': 0,
'@typescript-eslint/prefer-enum-initializers': 0,
'@typescript-eslint/prefer-for-of': 0,
'@typescript-eslint/prefer-function-type': 0,
'@typescript-eslint/prefer-includes': 0,
'@typescript-eslint/prefer-literal-enum-member': 0,
'@typescript-eslint/prefer-namespace-keyword': 0,
'@typescript-eslint/prefer-nullish-coalescing': 0,
'@typescript-eslint/prefer-optional-chain': 0,
'@typescript-eslint/prefer-readonly': 0,
'@typescript-eslint/prefer-readonly-parameter-types': 0,
'@typescript-eslint/prefer-reduce-type-parameter': 0,
'@typescript-eslint/prefer-regexp-exec': 0,
'@typescript-eslint/prefer-string-starts-ends-with': 0,
'@typescript-eslint/prefer-ts-expect-error': 0,
'@typescript-eslint/promise-function-async': 0,
quotes: 'off',
'@typescript-eslint/quotes': 0,
'@typescript-eslint/require-array-sort-compare': 0,
'require-await': 'off',
'@typescript-eslint/require-await': 0,
'@typescript-eslint/restrict-plus-operands': 0,
'@typescript-eslint/restrict-template-expressions': 0,
'no-return-await': 'off',
'@typescript-eslint/return-await': 0,
semi: 'off',
'@typescript-eslint/semi': 0,
'space-before-function-paren': 'off',
'@typescript-eslint/space-before-function-paren': 0,
'space-infix-ops': 'off',
'@typescript-eslint/space-infix-ops': 0,
'@typescript-eslint/strict-boolean-expressions': 0,
'@typescript-eslint/triple-slash-reference': 'error',
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/typedef': 'error',
'@typescript-eslint/unbound-method': 0,
'@typescript-eslint/unified-signatures': 'error',
'@typescript-eslint/indent': 0,
'@typescript-eslint/no-use-before-define': ['off'],
camelcase: 0,
'@typescript-eslint/camelcase': 0,
'@typescript-eslint/no-var-requires': 0,
// Common abbreviations are known and readable
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/interface-name-prefix': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/ban-types': 1,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/naming-convention': 0,
},
settings: {
react: {
pragma: 'React',
version: 'detect',
},
},
});
9 changes: 6 additions & 3 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
const fabric = require('@umijs/fabric');

module.exports = {
...fabric.prettier,
singleQuote: true,
trailingComma: 'all',
tabWidth: 2,
endOfLine: 'auto',
semi: true,
printWidth: 120,
};
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 hemengke

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit fa92946

Please sign in to comment.