Skip to content

Commit

Permalink
chore: Add eslintrc flavors
Browse files Browse the repository at this point in the history
  • Loading branch information
Hypfer committed Jul 21, 2022
1 parent e10313d commit b3843f8
Show file tree
Hide file tree
Showing 11 changed files with 429 additions and 20 deletions.
18 changes: 18 additions & 0 deletions .automated_overrides.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"rules": {
"brace-style": ["error", "1tbs"],
"no-trailing-spaces": ["error", { "ignoreComments": true }],
"keyword-spacing": "error",
"eol-last": ["error", "always"],
"no-multi-spaces": ["error", { "ignoreEOLComments": true }],
"semi": ["error", "always"],
"quotes": ["error", "double"],
"indent": [
"error",
4,
{
"SwitchCase": 1
}
]
}
}
32 changes: 17 additions & 15 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,13 @@
"block-scoped-var": "error",
"no-new": "error",
"no-multi-str": "error",
"no-multi-spaces": ["error", { "ignoreEOLComments": true }],
"no-new-wrappers": "error",
"no-sequences": "error",
"no-self-compare": "error",
"no-multi-assign": "error",
"no-whitespace-before-property": "error",
"no-magic-numbers": ["off", { "ignoreArrayIndexes": true }],
"no-unused-vars": ["error", { "args": "none" }],
"semi": ["error", "always"],
"quotes": ["error", "double"],
"indent": [
"error",
4,
{
"SwitchCase": 1
}
],
"brace-style": ["error", "1tbs"],
"no-trailing-spaces": ["error", { "ignoreComments": true }],
"keyword-spacing": "error",
"eol-last": ["error", "always"],
"jsdoc/check-alignment": "error",
"jsdoc/check-param-names": "error",
"jsdoc/check-tag-names": "error",
Expand All @@ -72,7 +58,23 @@
"operator-linebreak": ["error", "after"],
"no-unneeded-ternary": ["error", { "defaultAssignment": false }],
"arrow-body-style": ["error", "always"],
"regexp/no-unused-capturing-group": "off"
"regexp/no-unused-capturing-group": "off",


"brace-style": ["off", "1tbs"],
"no-trailing-spaces": ["off", { "ignoreComments": true }],
"keyword-spacing": "off",
"eol-last": ["off", "always"],
"no-multi-spaces": ["off", { "ignoreEOLComments": true }],
"semi": ["off", "always"],
"quotes": ["off", "double"],
"indent": [
"off",
4,
{
"SwitchCase": 1
}
]
},
"overrides": [
{
Expand Down
5 changes: 5 additions & 0 deletions .pedantic_overrides.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rules": {
"no-magic-numbers": ["error", { "ignoreArrayIndexes": true }]
}
}
68 changes: 68 additions & 0 deletions backend/.automated.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"overrides": [
{
"files": [
"lib/**/index.js"
],
"rules": {
"sort-keys-fix/sort-keys-fix": "warn"
}
},
{
"files": [
"index.js",
"lib/**/*.js",
"util/**/*.js"
],
"parserOptions": {
"ecmaVersion": 2020
},
"extends": [
"eslint:recommended",
"plugin:node/recommended"
],
"rules": {
"no-process-exit": "off",
"node/no-process-exit": "off"
}
}
],
"rules": {
"brace-style": [
"error",
"1tbs"
],
"no-trailing-spaces": [
"error",
{
"ignoreComments": true
}
],
"keyword-spacing": "error",
"eol-last": [
"error",
"always"
],
"no-multi-spaces": [
"error",
{
"ignoreEOLComments": true
}
],
"semi": [
"error",
"always"
],
"quotes": [
"error",
"double"
],
"indent": [
"error",
4,
{
"SwitchCase": 1
}
]
}
}
74 changes: 74 additions & 0 deletions backend/.pedantic.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"overrides": [
{
"files": [
"lib/**/index.js"
],
"rules": {
"sort-keys-fix/sort-keys-fix": "warn"
}
},
{
"files": [
"index.js",
"lib/**/*.js",
"util/**/*.js"
],
"parserOptions": {
"ecmaVersion": 2020
},
"extends": [
"eslint:recommended",
"plugin:node/recommended"
],
"rules": {
"no-process-exit": "off",
"node/no-process-exit": "off"
}
}
],
"rules": {
"brace-style": [
"error",
"1tbs"
],
"no-trailing-spaces": [
"error",
{
"ignoreComments": true
}
],
"keyword-spacing": "error",
"eol-last": [
"error",
"always"
],
"no-multi-spaces": [
"error",
{
"ignoreEOLComments": true
}
],
"semi": [
"error",
"always"
],
"quotes": [
"error",
"double"
],
"indent": [
"error",
4,
{
"SwitchCase": 1
}
],
"no-magic-numbers": [
"error",
{
"ignoreArrayIndexes": true
}
]
}
}
5 changes: 3 additions & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
"scripts": {
"start": "node index.js",
"start:dev": "cross-env VALETUDO_CONFIG_PATH=../local/valetudo_config.json npm run start",
"lint": "eslint .",
"lint_fix": "eslint . --fix",
"lint": "eslint -c .automated.eslintrc.json .",
"lint_fix": "eslint -c .automated.eslintrc.json . --fix",
"lint_pedantic": "eslint -c .pedantic.eslintrc.json .",
"ts-check": "tsc --noEmit",
"test": "mocha \"test/**/*_spec.js\"",
"prepare_commit": "npm run lint_fix && npm run ts-check && npm run test",
Expand Down
88 changes: 88 additions & 0 deletions frontend/.automated.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": [
"react",
"@typescript-eslint"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"settings": {
"react": {
"version": "detect"
},
"linkComponents": [
"Hyperlink",
{
"name": "Link",
"linkAttribute": "to"
}
]
},
"rules": {
"@typescript-eslint/no-unused-vars": [
"warn",
{
"varsIgnorePattern": "^_",
"args": "none"
}
],
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react/prop-types": "off",
"brace-style": [
"error",
"1tbs"
],
"no-trailing-spaces": [
"error",
{
"ignoreComments": true
}
],
"keyword-spacing": "error",
"eol-last": [
"error",
"always"
],
"no-multi-spaces": [
"error",
{
"ignoreEOLComments": true
}
],
"semi": [
"error",
"always"
],
"quotes": [
"error",
"double"
],
"indent": [
"error",
4,
{
"SwitchCase": 1
}
]
}
}
Loading

0 comments on commit b3843f8

Please sign in to comment.