mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-24 08:20:31 +08:00
65 lines
1.9 KiB
Plaintext
65 lines
1.9 KiB
Plaintext
{
|
|
"env": {
|
|
"browser": true,
|
|
"es6": true,
|
|
"node": true
|
|
},
|
|
"parser": "babel-eslint",
|
|
"parserOptions": {
|
|
"ecmaVersion": 12,
|
|
"sourceType": "module",
|
|
"ecmaFeatures": {
|
|
"jsx": true
|
|
}
|
|
},
|
|
"settings": {
|
|
"react": {
|
|
"version": "detect"
|
|
}
|
|
},
|
|
"extends": ["eslint:recommended", "plugin:react/recommended"],
|
|
"rules": {
|
|
// "eqeqeq": "error",
|
|
"semi": ["error", "always"],
|
|
"indent": ["error", 2],
|
|
// follow antd's style guide
|
|
"quotes": ["error", "double"],
|
|
"jsx-quotes": ["error", "prefer-double"],
|
|
"space-in-parens": ["error", "never"],
|
|
"object-curly-spacing": ["error", "never"],
|
|
"array-bracket-spacing": ["error", "never"],
|
|
"comma-spacing": ["error", { "before": false, "after": true }],
|
|
"react/jsx-curly-spacing": [
|
|
"error",
|
|
{ "when": "never", "allowMultiline": true, "children": true }
|
|
],
|
|
"arrow-spacing": ["error", { "before": true, "after": true }],
|
|
"space-before-blocks": ["error", "always"],
|
|
"spaced-comment": ["error", "always"],
|
|
"react/jsx-tag-spacing": ["error", { "beforeSelfClosing": "always" }],
|
|
"block-spacing": ["error", "never"],
|
|
"space-before-function-paren": ["error", "never"],
|
|
"no-trailing-spaces": ["error", { "ignoreComments": true }],
|
|
"eol-last": ["error", "always"],
|
|
// "no-var": ["error"],
|
|
"curly": ["error", "all"],
|
|
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
|
|
"no-mixed-spaces-and-tabs": "error",
|
|
"sort-imports": ["error", {
|
|
"ignoreDeclarationSort": true
|
|
}],
|
|
"no-multiple-empty-lines": ["error", { "max": 1, "maxBOF": 0, "maxEOF": 0 }],
|
|
|
|
|
|
"react/prop-types": "off",
|
|
"react/display-name": "off",
|
|
"react/react-in-jsx-scope": "off",
|
|
|
|
// don't use strict mod now, otherwise there are a lot of errors in the codebase
|
|
"no-unused-vars": "warn",
|
|
"react/no-deprecated": "warn",
|
|
"no-case-declarations": "warn",
|
|
"react/jsx-key": "warn"
|
|
}
|
|
}
|