eslint-config-xx
v1.10.1
Published
eslint config xx
Downloads
339
Maintainers
Readme
eslint-config-xx
Support js/ts/jsx/tsx and export prettier config
install
yarn install eslint-config-xx -D
eslint config
.eslintrc.js
module.exports = {
extends: 'xx',
overrides: [],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
// '@typescript-eslint/space-before-function-paren': 'off',
// '@typescript-eslint/explicit-function-return-type': 'off',
// '@typescript-eslint/strict-boolean-expressions': 'off',
// '@typescript-eslint/no-confusing-void-expression': 'off',
// '@typescript-eslint/triple-slash-reference': 'off',
// '@typescript-eslint/indent': 'off',
// '@typescript-eslint/await-thenable': 'off',
// 'multiline-ternary': 'off',
// '@typescript-eslint/no-unused-vars': 1, // warn
// 'react-hooks/exhaustive-deps': 2 // error
},
}
prettier config
.prettierrc.js
module.exports = {
...require('eslint-config-xx/prettier.config'),
}
js 项目
Parsing error: project was set to true
but couldn't find any tsconfig.json relative
在根目录下新建tsconfig.json
{
"compilerOptions": {
"module": "esnext",
"target": "ES2015",
"lib": ["es6", "dom", "es2016", "es2017"],
"sourceMap": true,
"allowJs": true,
"outDir": "dist",
"moduleResolution": "node",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"jsx": "react-jsx"
},
"include": ["./index.js", "./.prettierrc.cjs"],
"exclude": ["node_modules"]
}