fabric icon indicating copy to clipboard operation
fabric copied to clipboard

使用 @typescript-eslint/naming-convention 提交代码报错

Open crazyair opened this issue 5 years ago • 0 comments

husky > pre-commit (node v10.21.0)
✔ Preparing...
⚠ Running tasks...
  ❯ Running tasks for *.{ts,tsx,js,jsx}
    ✖ eslint --fix [FAILED]
    ◼ prettier --write
  ↓ No staged files match .{less,css,json} [SKIPPED]
↓ Skipped because of errors from tasks. [SKIPPED]
✔ Reverting to original state because of errors...
✔ Cleaning up... 

✖ eslint --fix:

/Users/crazyair/demo/.eslintrc.js
  0:0  error  Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: .eslintrc.js.
The file must be included in at least one of the projects provided

.eslintrc.js

module.exports = {
  plugins: ['react-hooks'],
  extends: [require.resolve('@umijs/fabric/dist/eslint')],
  rules: {
    'react-hooks/rules-of-hooks': 'error', // 检查 Hook 的规则
    'react-hooks/exhaustive-deps': 'error', // 检查 effect 的依赖
    'import/no-unresolved': 0,
    'no-underscore-dangle': 0,
    'import/no-extraneous-dependencies': 0,
    'global-require': 0,
    'import/no-dynamic-require': 0,
    'react/sort-comp': 0,
    'jsx-a11y/aria-role': 0,
    'no-void': 0,
    'no-param-reassign': 0,
    'no-control-regex': 0,
    'no-plusplus': 0,
    'consistent-return': 0,
    'no-template-curly-in-string': 0,
    'prefer-promise-reject-errors': 0,
    'no-lonely-if': 0,
    'no-shadow': 0,
    'no-console': 0,
    '@typescript-eslint/naming-convention': 0,
  },
};

crazyair avatar Jul 09 '20 01:07 crazyair