Skip to content

Commit

Permalink
use only the necessary parts of the unicorn rules.
Browse files Browse the repository at this point in the history
  • Loading branch information
jinmayamashita authored Mar 17, 2024
1 parent 99d544a commit bcdb969
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions packages/eslint-config-custom/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,36 @@ module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:unicorn/recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
plugins: ['@typescript-eslint', 'react'],
plugins: ["unicorn"],
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.json', './tsconfig.node.json'],
},
rules: {
'no-console': 2,
eqeqeq: 2,
"unicorn/filename-case": [2, { case: "kebabCase" }],
"react/jsx-filename-extension": [2, { extensions: [".tsx"] }],
// Best practices for writing efficient JavaScript code
"unicorn/no-array-for-each": 1,
"unicorn/no-array-push-push": 1,
"unicorn/no-array-reduce": 1,
"unicorn/no-for-loop": 1,
"unicorn/prefer-array-find": 1,
"unicorn/prefer-array-flat": 1,
"unicorn/prefer-array-flat-map": 1,
"unicorn/prefer-object-from-entries": 1,
"unicorn/no-useless-length-check": 1,
"unicorn/better-regex": 1,
"unicorn/no-negated-condition": 1,
"unicorn/prefer-add-event-listener": 1,
"unicorn/no-nested-ternary": 2,
// Code readability
"unicorn/prevent-abbreviations": [2, { allowList: { Props: true } }],
},
overrides: [
{
Expand Down Expand Up @@ -71,16 +88,8 @@ module.exports = {
'react/no-unstable-nested-components': 2,
'react/prefer-stateless-function': 2,
'react/jsx-no-useless-fragment': 2,
'react/forbid-component-props': 2,
'unicorn/prevent-abbreviations': [
'error',
{
allowList: {
Props: true,
},
},
],
'react/forbid-component-props': 2
},
},
],
};
};

0 comments on commit bcdb969

Please sign in to comment.