支持 vue、jsx、js、ts、tsx、html
yarn add -D @sishuguojixuefu/eslint-config
Config in package.json:
{
"eslintConfig": {
"extends": ["@sishuguojixuefu"]
},
"eslintIgnore": ["!.eslintrc.js", "!.prettierrc.js", "index.js"],
"prettier": "@sishuguojixuefu/eslint-config/.prettierrc.js"
}
Add to your eslint config (.eslintrc.js
):
module.exports = {
root: true,
extends: '@sishuguojixuefu',
}
module.exports = {
root: true,
extends: '@sishuguojixuefu',
env: {
'react-native/react-native': true,
},
}
module.exports = {
root: true,
extends: '@sishuguojixuefu',
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaFeatures: {
legacyDecorators: true,
},
},
}
!.eslintrc.js
!.prettierrc.js
module.exports = {
...require('@sishuguojixuefu/eslint-config/.prettierrc.js'),
}
**/node_modules/*
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
[*.gradle]
indent_size = 4
[BUCK]
indent_size = 4