Skip to content

Commit

Permalink
feat: vendor/cleanup eslint-config-prettier rules
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgroshkov committed Aug 12, 2024
1 parent 511ca48 commit 54e2899
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 249 deletions.
110 changes: 110 additions & 0 deletions cfg/eslint-prettier-rules.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
// These rules are disabled, because prettier handles it
// Copy-pasted from https://github.com/prettier/eslint-config-prettier
module.exports = {
rules: {
// The following rules can be used in some cases. See the README for more
// information. These are marked with `0` instead of `0` so that a
// script can distinguish them. Note that there are a few more of these
// in the deprecated section below.
// "curly": 0,
'no-unexpected-multiline': 0,
'@typescript-eslint/lines-around-comment': 0,
'@typescript-eslint/quotes': 0,
'babel/quotes': 0,
'unicorn/template-indent': 0,
'vue/html-self-closing': 0,
'vue/max-len': 0,

// The rest are rules that you never need to enable when using Prettier.
'@babel/object-curly-spacing': 0,
'@babel/semi': 0,
'@typescript-eslint/block-spacing': 0,
'@typescript-eslint/brace-style': 0,
'@typescript-eslint/comma-dangle': 0,
'@typescript-eslint/comma-spacing': 0,
'@typescript-eslint/func-call-spacing': 0,
'@typescript-eslint/indent': 0,
'@typescript-eslint/key-spacing': 0,
'@typescript-eslint/keyword-spacing': 0,
'@typescript-eslint/member-delimiter-style': 0,
'@typescript-eslint/no-extra-parens': 0,
'@typescript-eslint/no-extra-semi': 0,
'@typescript-eslint/object-curly-spacing': 0,
'@typescript-eslint/semi': 0,
'@typescript-eslint/space-before-blocks': 0,
'@typescript-eslint/space-before-function-paren': 0,
'@typescript-eslint/space-infix-ops': 0,
'@typescript-eslint/type-annotation-spacing': 0,
'babel/object-curly-spacing': 0,
'babel/semi': 0,
'flowtype/boolean-style': 0,
'flowtype/delimiter-dangle': 0,
'flowtype/generic-spacing': 0,
'flowtype/object-type-curly-spacing': 0,
'flowtype/object-type-delimiter': 0,
'flowtype/quotes': 0,
'flowtype/semi': 0,
'flowtype/space-after-type-colon': 0,
'flowtype/space-before-generic-bracket': 0,
'flowtype/space-before-type-colon': 0,
'flowtype/union-intersection-spacing': 0,
'react/jsx-child-element-spacing': 0,
'react/jsx-closing-bracket-location': 0,
'react/jsx-closing-tag-location': 0,
'react/jsx-curly-newline': 0,
'react/jsx-curly-spacing': 0,
'react/jsx-equals-spacing': 0,
'react/jsx-first-prop-new-line': 0,
'react/jsx-indent': 0,
'react/jsx-indent-props': 0,
'react/jsx-max-props-per-line': 0,
'react/jsx-newline': 0,
'react/jsx-one-expression-per-line': 0,
'react/jsx-props-no-multi-spaces': 0,
'react/jsx-tag-spacing': 0,
'react/jsx-wrap-multilines': 0,
'standard/array-bracket-even-spacing': 0,
'standard/computed-property-even-spacing': 0,
'standard/object-curly-even-spacing': 0,
'unicorn/empty-brace-spaces': 0,
'unicorn/no-nested-ternary': 0,
'unicorn/number-literal-case': 0,
'vue/array-bracket-newline': 0,
'vue/array-bracket-spacing': 0,
'vue/array-element-newline': 0,
'vue/arrow-spacing': 0,
'vue/block-spacing': 0,
'vue/block-tag-newline': 0,
'vue/brace-style': 0,
'vue/comma-dangle': 0,
'vue/comma-spacing': 0,
'vue/comma-style': 0,
'vue/dot-location': 0,
'vue/func-call-spacing': 0,
'vue/html-closing-bracket-newline': 0,
'vue/html-closing-bracket-spacing': 0,
'vue/html-end-tags': 0,
'vue/html-indent': 0,
'vue/html-quotes': 0,
'vue/key-spacing': 0,
'vue/keyword-spacing': 0,
'vue/max-attributes-per-line': 0,
'vue/multiline-html-element-content-newline': 0,
'vue/multiline-ternary': 0,
'vue/mustache-interpolation-spacing': 0,
'vue/no-extra-parens': 0,
'vue/no-multi-spaces': 0,
'vue/no-spaces-around-equal-signs-in-attribute': 0,
'vue/object-curly-newline': 0,
'vue/object-curly-spacing': 0,
'vue/object-property-newline': 0,
'vue/operator-linebreak': 0,
'vue/quote-props': 0,
'vue/script-indent': 0,
'vue/singleline-html-element-content-newline': 0,
'vue/space-in-parens': 0,
'vue/space-infix-ops': 0,
'vue/space-unary-ops': 0,
'vue/template-curly-spacing': 0,
},
}
4 changes: 1 addition & 3 deletions cfg/eslint-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ module.exports = {
},
],
'constructor-super': 2,
'eol-last': 2,
eqeqeq: [2, 'smart'],
'for-direction': 2,
'getter-return': 2,
Expand Down Expand Up @@ -232,7 +231,6 @@ module.exports = {
'no-invalid-this': 0, // too many false positives in valid classes
'no-irregular-whitespace': 2,
'no-misleading-character-class': 2,
'no-mixed-spaces-and-tabs': 2,
'no-new-symbol': 2,
'no-new-wrappers': 2,
'no-obj-calls': 2,
Expand Down Expand Up @@ -266,6 +264,7 @@ module.exports = {
'rxjs/observable/interval',
'rxjs/observable/forkJoin',
],
curly: [2, 'multi-line'], // this one is an exception that can conflict with prettier
'no-self-assign': 2,
'no-setter-return': 2,
'no-shadow': 0, // it is buggy with TypeScript enums
Expand Down Expand Up @@ -348,7 +347,6 @@ module.exports = {
'@typescript-eslint/prefer-find': 2,
'prefer-promise-reject-errors': 0,
'@typescript-eslint/prefer-promise-reject-errors': 2,
'arrow-parens': [2, 'as-needed'],
'arrow-body-style': 0,
'unicorn/no-array-callback-reference': 0, // false positives
'unicorn/no-process-exit': 0,
Expand Down
4 changes: 1 addition & 3 deletions cfg/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ function getConfig() {
...require('./eslint-rules').rules,
...require('./eslint-vue-rules').rules,
...(hasJest ? require('./eslint-jest-rules').rules : {}),
...require('eslint-config-prettier').rules,
...require('./eslint-prettier-rules').rules,
...require('./eslint-biome-rules').rules, // disable eslint rules already covered by biome
// Override prettier-config:
curly: [2, 'multi-line'],
},
}
}
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"@types/node": "^22.0.0",
"@types/yargs": "^16.0.0",
"eslint": "^9.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-import-x": "^3.1.0",
"eslint-plugin-jest": "^28.0.0",
"eslint-plugin-jsdoc": "^50.0.0",
Expand Down
Loading

0 comments on commit 54e2899

Please sign in to comment.