configs: use rules in relevant configs
This commit is contained in:
parent
86ab43aeb4
commit
56a4255144
127
core.js
127
core.js
@ -21,4 +21,131 @@ module.exports = {
|
||||
},
|
||||
],
|
||||
plugins: ['canonical', 'sonarjs', '@typescript-eslint', 'prettier'],
|
||||
rules: {
|
||||
// Disabled
|
||||
'brace-style': 'off',
|
||||
'@typescript-eslint/brace-style': 'off',
|
||||
'comma-dangle': 'off',
|
||||
'@typescript-eslint/comma-dangle': 'off',
|
||||
'comma-spacing': 'off',
|
||||
'@typescript-eslint/comma-spacing': 'off',
|
||||
'func-call-spacing': 'off',
|
||||
'@typescript-eslint/func-call-spacing': 'off',
|
||||
indent: 'off',
|
||||
'@typescript-eslint/indent': 'off',
|
||||
'keyword-spacing': 'off',
|
||||
'@typescript-eslint/keyword-spacing': 'off',
|
||||
'lines-between-class-members': 'off',
|
||||
'@typescript-eslint/lines-between-class-members': 'off',
|
||||
'@typescript-eslint/member-delimiter-style': 'off',
|
||||
'no-extra-parens': 'off',
|
||||
'@typescript-eslint/no-extra-parens': 'off',
|
||||
'object-curly-spacing': 'off',
|
||||
'@typescript-eslint/object-curly-spacing': 'off',
|
||||
'padding-line-between-statements': 'off',
|
||||
'@typescript-eslint/padding-line-between-statements': 'off',
|
||||
quotes: 'off',
|
||||
'@typescript-eslint/quotes': 'off',
|
||||
semi: 'off',
|
||||
'@typescript-eslint/semi': 'off',
|
||||
'space-before-blocks': 'off',
|
||||
'@typescript-eslint/space-before-blocks': 'off',
|
||||
'space-before-function-paren': 'off',
|
||||
'@typescript-eslint/space-before-function-paren': 'off',
|
||||
'space-infix-ops': 'off',
|
||||
'@typescript-eslint/space-infix-ops': 'off',
|
||||
'@typescript-eslint/type-annotation-spacing': 'off',
|
||||
|
||||
// Config
|
||||
'linebreak-style': ['error', 'windows'],
|
||||
'import/extensions': 'off',
|
||||
'newline-before-return': 'warn',
|
||||
'@typescript-eslint/consistent-type-imports': 'error',
|
||||
'function-paren-newline': 'off',
|
||||
'promise/prefer-await-to-then': 'off',
|
||||
'@typescript-eslint/explicit-member-accessibility': [
|
||||
'warn',
|
||||
{
|
||||
accessibility: 'explicit',
|
||||
overrides: {
|
||||
constructors: 'off',
|
||||
},
|
||||
},
|
||||
],
|
||||
'id-length': 'warn',
|
||||
'import/no-unassigned-import': 'off',
|
||||
'import/no-named-as-default-member': 'warn',
|
||||
'@typescript-eslint/naming-convention': 'warn',
|
||||
|
||||
// Unicorn
|
||||
'unicorn/no-array-for-each': 'off',
|
||||
'unicorn/prevent-abbreviations': 'off',
|
||||
'unicorn/prefer-node-protocol': 'off',
|
||||
'unicorn/no-array-reduce': 'off',
|
||||
'unicorn/prefer-module': 'off',
|
||||
'unicorn/text-encoding-identifier-case': 'off',
|
||||
'unicorn/filename-case': [
|
||||
'error',
|
||||
{
|
||||
case: 'kebabCase',
|
||||
ignore: ['^.*.(jsx|tsx)$'],
|
||||
},
|
||||
],
|
||||
'unicorn/numeric-separators-style': [
|
||||
'warn',
|
||||
{
|
||||
onlyIfContainsSeparator: false,
|
||||
hexadecimal: {
|
||||
minimumDigits: 0,
|
||||
groupLength: 2,
|
||||
},
|
||||
binary: {
|
||||
minimumDigits: 0,
|
||||
groupLength: 4,
|
||||
},
|
||||
octal: {
|
||||
minimumDigits: 0,
|
||||
groupLength: 4,
|
||||
},
|
||||
number: {
|
||||
minimumDigits: 5,
|
||||
groupLength: 3,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
// Canonical
|
||||
'canonical/prefer-inline-type-import': 'off',
|
||||
'@babel/object-curly-spacing': ['off'],
|
||||
'canonical/filename-match-exported': ['off'],
|
||||
'canonical/import-specifier-newline': ['off'],
|
||||
'canonical/destructuring-property-newline': ['off'],
|
||||
'canonical/export-specifier-newline': 'off',
|
||||
'canonical/sort-keys': [
|
||||
'warn',
|
||||
'asc',
|
||||
{
|
||||
natural: true,
|
||||
},
|
||||
],
|
||||
'canonical/id-match': ['off'],
|
||||
'import/order': [
|
||||
'error',
|
||||
{
|
||||
groups: [],
|
||||
'newlines-between': 'always',
|
||||
},
|
||||
],
|
||||
'func-style': ['warn', 'declaration', { allowArrowFunctions: true }],
|
||||
'arrow-body-style': [
|
||||
'error',
|
||||
'as-needed',
|
||||
{
|
||||
requireReturnForObjectLiteral: false,
|
||||
},
|
||||
],
|
||||
|
||||
// Sonar
|
||||
'sonarjs/no-duplicate-string': 'warn',
|
||||
},
|
||||
};
|
||||
|
||||
153
index.js
153
index.js
@ -21,7 +21,11 @@ module.exports = {
|
||||
files: '*.ts',
|
||||
},
|
||||
{
|
||||
extends: ['canonical/react', 'canonical/jsx-a11y', 'canonical/typescript'],
|
||||
extends: [
|
||||
'canonical/react',
|
||||
'canonical/jsx-a11y',
|
||||
'canonical/typescript',
|
||||
],
|
||||
files: '*.tsx',
|
||||
},
|
||||
{
|
||||
@ -41,5 +45,150 @@ module.exports = {
|
||||
extends: ['plugin:testing-library/react', 'canonical/jest'],
|
||||
},
|
||||
],
|
||||
plugins: ['canonical', 'sonarjs', '@typescript-eslint', 'prettier', 'testing-library'],
|
||||
plugins: [
|
||||
'canonical',
|
||||
'sonarjs',
|
||||
'@typescript-eslint',
|
||||
'prettier',
|
||||
'testing-library',
|
||||
],
|
||||
rules: {
|
||||
// Disabled
|
||||
'brace-style': 'off',
|
||||
'@typescript-eslint/brace-style': 'off',
|
||||
'comma-dangle': 'off',
|
||||
'@typescript-eslint/comma-dangle': 'off',
|
||||
'comma-spacing': 'off',
|
||||
'@typescript-eslint/comma-spacing': 'off',
|
||||
'func-call-spacing': 'off',
|
||||
'@typescript-eslint/func-call-spacing': 'off',
|
||||
indent: 'off',
|
||||
'@typescript-eslint/indent': 'off',
|
||||
'keyword-spacing': 'off',
|
||||
'@typescript-eslint/keyword-spacing': 'off',
|
||||
'lines-between-class-members': 'off',
|
||||
'@typescript-eslint/lines-between-class-members': 'off',
|
||||
'@typescript-eslint/member-delimiter-style': 'off',
|
||||
'no-extra-parens': 'off',
|
||||
'@typescript-eslint/no-extra-parens': 'off',
|
||||
'object-curly-spacing': 'off',
|
||||
'@typescript-eslint/object-curly-spacing': 'off',
|
||||
'padding-line-between-statements': 'off',
|
||||
'@typescript-eslint/padding-line-between-statements': 'off',
|
||||
quotes: 'off',
|
||||
'@typescript-eslint/quotes': 'off',
|
||||
semi: 'off',
|
||||
'@typescript-eslint/semi': 'off',
|
||||
'space-before-blocks': 'off',
|
||||
'@typescript-eslint/space-before-blocks': 'off',
|
||||
'space-before-function-paren': 'off',
|
||||
'@typescript-eslint/space-before-function-paren': 'off',
|
||||
'space-infix-ops': 'off',
|
||||
'@typescript-eslint/space-infix-ops': 'off',
|
||||
'@typescript-eslint/type-annotation-spacing': 'off',
|
||||
|
||||
// Config
|
||||
'linebreak-style': ['error', 'windows'],
|
||||
'import/extensions': 'off',
|
||||
'react/prop-types': 'off',
|
||||
'newline-before-return': 'warn',
|
||||
'@typescript-eslint/consistent-type-imports': 'error',
|
||||
'function-paren-newline': 'off',
|
||||
'promise/prefer-await-to-then': 'off',
|
||||
'@typescript-eslint/explicit-member-accessibility': [
|
||||
'warn',
|
||||
{
|
||||
accessibility: 'explicit',
|
||||
overrides: {
|
||||
constructors: 'off',
|
||||
},
|
||||
},
|
||||
],
|
||||
'id-length': 'warn',
|
||||
'import/no-unassigned-import': 'off',
|
||||
'import/no-named-as-default-member': 'warn',
|
||||
'react/jsx-sort-props': 'off',
|
||||
'@typescript-eslint/naming-convention': 'warn',
|
||||
|
||||
// Unicorn
|
||||
'unicorn/no-array-for-each': 'off',
|
||||
'unicorn/prevent-abbreviations': 'off',
|
||||
'unicorn/prefer-node-protocol': 'off',
|
||||
'unicorn/no-array-reduce': 'off',
|
||||
'unicorn/prefer-module': 'off',
|
||||
'unicorn/text-encoding-identifier-case': 'off',
|
||||
'unicorn/filename-case': [
|
||||
'error',
|
||||
{
|
||||
case: 'kebabCase',
|
||||
ignore: ['^.*.(jsx|tsx)$'],
|
||||
},
|
||||
],
|
||||
'unicorn/numeric-separators-style': [
|
||||
'warn',
|
||||
{
|
||||
onlyIfContainsSeparator: false,
|
||||
hexadecimal: {
|
||||
minimumDigits: 0,
|
||||
groupLength: 2,
|
||||
},
|
||||
binary: {
|
||||
minimumDigits: 0,
|
||||
groupLength: 4,
|
||||
},
|
||||
octal: {
|
||||
minimumDigits: 0,
|
||||
groupLength: 4,
|
||||
},
|
||||
number: {
|
||||
minimumDigits: 5,
|
||||
groupLength: 3,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
// Canonical
|
||||
'canonical/prefer-inline-type-import': 'off',
|
||||
'@babel/object-curly-spacing': ['off'],
|
||||
'canonical/filename-match-exported': ['off'],
|
||||
'canonical/import-specifier-newline': ['off'],
|
||||
'canonical/destructuring-property-newline': ['off'],
|
||||
'canonical/export-specifier-newline': 'off',
|
||||
'canonical/sort-keys': [
|
||||
'warn',
|
||||
'asc',
|
||||
{
|
||||
natural: true,
|
||||
},
|
||||
],
|
||||
'canonical/id-match': ['off'],
|
||||
'import/order': [
|
||||
'error',
|
||||
{
|
||||
groups: [],
|
||||
'newlines-between': 'always',
|
||||
},
|
||||
],
|
||||
'func-style': ['warn', 'declaration', { allowArrowFunctions: true }],
|
||||
'react/function-component-definition': [
|
||||
'error',
|
||||
{
|
||||
namedComponents: 'function-declaration',
|
||||
unnamedComponents: 'arrow-function',
|
||||
},
|
||||
],
|
||||
'arrow-body-style': [
|
||||
'error',
|
||||
'as-needed',
|
||||
{
|
||||
requireReturnForObjectLiteral: false,
|
||||
},
|
||||
],
|
||||
|
||||
// Sonar
|
||||
'sonarjs/no-duplicate-string': 'warn',
|
||||
|
||||
// Zod
|
||||
'zod/require-strict': 'off',
|
||||
},
|
||||
};
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vchikalkin/eslint-config-awesome",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"devDependencies": {
|
||||
@ -23,9 +23,12 @@
|
||||
"repository": "https://github.com/vchikalkin/eslint-config-awesome",
|
||||
"author": "vchikalkin",
|
||||
"keywords": [
|
||||
"eslint",
|
||||
"config",
|
||||
"eslint",
|
||||
"json",
|
||||
"nextjs",
|
||||
"prettier"
|
||||
"prettier",
|
||||
"react",
|
||||
"zod"
|
||||
]
|
||||
}
|
||||
|
||||
11
react.js
vendored
11
react.js
vendored
@ -18,4 +18,15 @@ module.exports = {
|
||||
files: '*.jsx',
|
||||
},
|
||||
],
|
||||
rules: {
|
||||
'react/prop-types': 'off',
|
||||
'react/jsx-sort-props': 'off',
|
||||
'react/function-component-definition': [
|
||||
'error',
|
||||
{
|
||||
namedComponents: 'function-declaration',
|
||||
unnamedComponents: 'arrow-function',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
141
rules.js
141
rules.js
@ -1,141 +0,0 @@
|
||||
module.exports = {
|
||||
rules: {
|
||||
// Disabled
|
||||
'brace-style': 'off',
|
||||
'@typescript-eslint/brace-style': 'off',
|
||||
'comma-dangle': 'off',
|
||||
'@typescript-eslint/comma-dangle': 'off',
|
||||
'comma-spacing': 'off',
|
||||
'@typescript-eslint/comma-spacing': 'off',
|
||||
'func-call-spacing': 'off',
|
||||
'@typescript-eslint/func-call-spacing': 'off',
|
||||
indent: 'off',
|
||||
'@typescript-eslint/indent': 'off',
|
||||
'keyword-spacing': 'off',
|
||||
'@typescript-eslint/keyword-spacing': 'off',
|
||||
'lines-between-class-members': 'off',
|
||||
'@typescript-eslint/lines-between-class-members': 'off',
|
||||
'@typescript-eslint/member-delimiter-style': 'off',
|
||||
'no-extra-parens': 'off',
|
||||
'@typescript-eslint/no-extra-parens': 'off',
|
||||
'object-curly-spacing': 'off',
|
||||
'@typescript-eslint/object-curly-spacing': 'off',
|
||||
'padding-line-between-statements': 'off',
|
||||
'@typescript-eslint/padding-line-between-statements': 'off',
|
||||
quotes: 'off',
|
||||
'@typescript-eslint/quotes': 'off',
|
||||
semi: 'off',
|
||||
'@typescript-eslint/semi': 'off',
|
||||
'space-before-blocks': 'off',
|
||||
'@typescript-eslint/space-before-blocks': 'off',
|
||||
'space-before-function-paren': 'off',
|
||||
'@typescript-eslint/space-before-function-paren': 'off',
|
||||
'space-infix-ops': 'off',
|
||||
'@typescript-eslint/space-infix-ops': 'off',
|
||||
'@typescript-eslint/type-annotation-spacing': 'off',
|
||||
|
||||
// Config
|
||||
'linebreak-style': ['error', 'windows'],
|
||||
'import/extensions': 'off',
|
||||
'react/prop-types': 'off',
|
||||
'newline-before-return': 'warn',
|
||||
'@typescript-eslint/consistent-type-imports': 'error',
|
||||
'function-paren-newline': 'off',
|
||||
'promise/prefer-await-to-then': 'off',
|
||||
'@typescript-eslint/explicit-member-accessibility': [
|
||||
'warn',
|
||||
{
|
||||
accessibility: 'explicit',
|
||||
overrides: {
|
||||
constructors: 'off',
|
||||
},
|
||||
},
|
||||
],
|
||||
'id-length': 'warn',
|
||||
'import/no-unassigned-import': 'off',
|
||||
'import/no-named-as-default-member': 'warn',
|
||||
'react/jsx-sort-props': 'off',
|
||||
'@typescript-eslint/naming-convention': 'warn',
|
||||
|
||||
// Unicorn
|
||||
'unicorn/no-array-for-each': 'off',
|
||||
'unicorn/prevent-abbreviations': 'off',
|
||||
'unicorn/prefer-node-protocol': 'off',
|
||||
'unicorn/no-array-reduce': 'off',
|
||||
'unicorn/prefer-module': 'off',
|
||||
'unicorn/text-encoding-identifier-case': 'off',
|
||||
'unicorn/filename-case': [
|
||||
'error',
|
||||
{
|
||||
case: 'kebabCase',
|
||||
ignore: ['^.*.(jsx|tsx)$'],
|
||||
},
|
||||
],
|
||||
'unicorn/numeric-separators-style': [
|
||||
'warn',
|
||||
{
|
||||
onlyIfContainsSeparator: false,
|
||||
hexadecimal: {
|
||||
minimumDigits: 0,
|
||||
groupLength: 2,
|
||||
},
|
||||
binary: {
|
||||
minimumDigits: 0,
|
||||
groupLength: 4,
|
||||
},
|
||||
octal: {
|
||||
minimumDigits: 0,
|
||||
groupLength: 4,
|
||||
},
|
||||
number: {
|
||||
minimumDigits: 5,
|
||||
groupLength: 3,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
// Canonical
|
||||
'canonical/prefer-inline-type-import': 'off',
|
||||
'@babel/object-curly-spacing': ['off'],
|
||||
'canonical/filename-match-exported': ['off'],
|
||||
'canonical/import-specifier-newline': ['off'],
|
||||
'canonical/destructuring-property-newline': ['off'],
|
||||
'canonical/export-specifier-newline': 'off',
|
||||
'canonical/sort-keys': [
|
||||
'warn',
|
||||
'asc',
|
||||
{
|
||||
natural: true,
|
||||
},
|
||||
],
|
||||
'canonical/id-match': ['off'],
|
||||
'import/order': [
|
||||
'error',
|
||||
{
|
||||
groups: [],
|
||||
'newlines-between': 'always',
|
||||
},
|
||||
],
|
||||
'func-style': ['warn', 'declaration', { allowArrowFunctions: true }],
|
||||
'react/function-component-definition': [
|
||||
'error',
|
||||
{
|
||||
namedComponents: 'function-declaration',
|
||||
unnamedComponents: 'arrow-function',
|
||||
},
|
||||
],
|
||||
'arrow-body-style': [
|
||||
'error',
|
||||
'as-needed',
|
||||
{
|
||||
requireReturnForObjectLiteral: false,
|
||||
},
|
||||
],
|
||||
|
||||
// Sonar
|
||||
'sonarjs/no-duplicate-string': 'warn',
|
||||
|
||||
// Zod
|
||||
'zod/require-strict': 'off',
|
||||
},
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user