merge project/eslint-rules
This commit is contained in:
parent
565cabb9bd
commit
78064edf81
@ -8,6 +8,5 @@ coverage
|
|||||||
.eslintrc.js
|
.eslintrc.js
|
||||||
**/*.config.js
|
**/*.config.js
|
||||||
**/scripts
|
**/scripts
|
||||||
packages/eslint-config-custom/*
|
|
||||||
**/package.json
|
**/package.json
|
||||||
turbo.json
|
turbo.json
|
||||||
@ -1,7 +1,5 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
root: true,
|
root: true,
|
||||||
// This tells ESLint to load the config from the package `eslint-config-custom`
|
|
||||||
extends: ['custom', 'custom/rules'],
|
|
||||||
settings: {
|
settings: {
|
||||||
next: {
|
next: {
|
||||||
rootDir: ['packages/web/'],
|
rootDir: ['packages/web/'],
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
root: true,
|
extends: [
|
||||||
extends: ['custom', 'custom/rules'],
|
'@vchikalkin/eslint-config-awesome/next-typescript/config',
|
||||||
|
'@vchikalkin/eslint-config-awesome/next-typescript/rules',
|
||||||
|
],
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
project: './tsconfig.json',
|
project: './tsconfig.json',
|
||||||
tsconfigRootDir: __dirname,
|
tsconfigRootDir: __dirname,
|
||||||
},
|
},
|
||||||
|
root: true,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -51,8 +51,8 @@
|
|||||||
"@types/react": "^18.2.14",
|
"@types/react": "^18.2.14",
|
||||||
"@types/react-dom": "^18.2.6",
|
"@types/react-dom": "^18.2.6",
|
||||||
"@types/styled-components": "^5.1.26",
|
"@types/styled-components": "^5.1.26",
|
||||||
"eslint": "^8.43.0",
|
"@vchikalkin/eslint-config-awesome": "^1.1.1",
|
||||||
"eslint-config-custom": "*",
|
"eslint": "^8.46.0",
|
||||||
"gql-sdl": "^1.0.0",
|
"gql-sdl": "^1.0.0",
|
||||||
"jest": "^29.4.3",
|
"jest": "^29.4.3",
|
||||||
"jest-environment-jsdom": "^29.3.1",
|
"jest-environment-jsdom": "^29.3.1",
|
||||||
|
|||||||
@ -17,7 +17,6 @@ import { useMemo } from 'react';
|
|||||||
import { ThemeProvider } from 'styled-components';
|
import { ThemeProvider } from 'styled-components';
|
||||||
import { Config as AntdConfig } from 'ui/elements';
|
import { Config as AntdConfig } from 'ui/elements';
|
||||||
|
|
||||||
// eslint-disable-next-line turbo/no-undeclared-env-vars
|
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
require('../mocks');
|
require('../mocks');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
/* eslint-disable complexity */
|
/* eslint-disable complexity */
|
||||||
/* eslint-disable sonarjs/cognitive-complexity */
|
/* eslint-disable sonarjs/cognitive-complexity */
|
||||||
/* eslint-disable zod/require-strict */
|
|
||||||
import type { ValidationContext } from '../types';
|
import type { ValidationContext } from '../types';
|
||||||
import type * as Insurance from '@/Components/Calculation/Form/Insurance/InsuranceTable/types';
|
import type * as Insurance from '@/Components/Calculation/Form/Insurance/InsuranceTable/types';
|
||||||
import { FinGAPSchema } from '@/config/schema/fingap';
|
import { FinGAPSchema } from '@/config/schema/fingap';
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable zod/require-strict */
|
|
||||||
import { CalculateInputSchema } from '../calculate/types';
|
import { CalculateInputSchema } from '../calculate/types';
|
||||||
import { RowSchema as EltRowSchema } from '@/config/schema/elt';
|
import { RowSchema as EltRowSchema } from '@/config/schema/elt';
|
||||||
import { RiskSchema } from '@/config/schema/fingap';
|
import { RiskSchema } from '@/config/schema/fingap';
|
||||||
|
|||||||
@ -22,7 +22,6 @@
|
|||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"dotenv-cli": "^7.0.0",
|
"dotenv-cli": "^7.0.0",
|
||||||
"eslint-config-custom": "*",
|
|
||||||
"husky": "^8.0.3",
|
"husky": "^8.0.3",
|
||||||
"lint-staged": "^13.2.0",
|
"lint-staged": "^13.2.0",
|
||||||
"prettier": "^2.8.4",
|
"prettier": "^2.8.4",
|
||||||
|
|||||||
@ -1,46 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
env: {
|
|
||||||
browser: true,
|
|
||||||
es2022: true,
|
|
||||||
node: true,
|
|
||||||
},
|
|
||||||
parserOptions: {
|
|
||||||
ecmaVersion: 2022,
|
|
||||||
},
|
|
||||||
parser: '@typescript-eslint/parser',
|
|
||||||
extends: [
|
|
||||||
'canonical',
|
|
||||||
'plugin:sonarjs/recommended',
|
|
||||||
'eslint:recommended',
|
|
||||||
'next',
|
|
||||||
'prettier',
|
|
||||||
'turbo',
|
|
||||||
],
|
|
||||||
overrides: [
|
|
||||||
{
|
|
||||||
extends: ['canonical/typescript', 'canonical/zod'],
|
|
||||||
files: '*.ts',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
extends: ['canonical/react', 'canonical/jsx-a11y', 'canonical/typescript'],
|
|
||||||
files: '*.tsx',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
extends: ['canonical/react', 'canonical/jsx-a11y'],
|
|
||||||
files: '*.jsx',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
extends: ['canonical/json'],
|
|
||||||
files: '*.json',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
extends: ['canonical/graphql'],
|
|
||||||
files: ['*.graphql'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
|
|
||||||
extends: ['plugin:testing-library/react', 'canonical/jest'],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
plugins: ['canonical', 'sonarjs', '@typescript-eslint', 'prettier', 'testing-library'],
|
|
||||||
};
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "eslint-config-custom",
|
|
||||||
"version": "0.0.0",
|
|
||||||
"license": "MIT",
|
|
||||||
"main": "index.js",
|
|
||||||
"devDependencies": {
|
|
||||||
"@typescript-eslint/parser": "^5.60.0",
|
|
||||||
"eslint": "^8.43.0",
|
|
||||||
"eslint-config-canonical": "^41.1.3",
|
|
||||||
"eslint-config-next": "^13.4.7",
|
|
||||||
"eslint-config-prettier": "^8.8.0",
|
|
||||||
"eslint-config-turbo": "^1.10.6",
|
|
||||||
"eslint-plugin-canonical": "^4.4.4",
|
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
|
||||||
"eslint-plugin-sonarjs": "^0.19.0",
|
|
||||||
"eslint-plugin-testing-library": "^5.11.0"
|
|
||||||
},
|
|
||||||
"publishConfig": {
|
|
||||||
"access": "public"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,144 +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',
|
|
||||||
|
|
||||||
// Turbo
|
|
||||||
'turbo/no-undeclared-env-vars': 'warn',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@ -1,6 +1,9 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
root: true,
|
root: true,
|
||||||
extends: ['custom', 'custom/rules'],
|
extends: [
|
||||||
|
'@vchikalkin/eslint-config-awesome/typescript/config',
|
||||||
|
'@vchikalkin/eslint-config-awesome/typescript/rules',
|
||||||
|
],
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
project: './tsconfig.json',
|
project: './tsconfig.json',
|
||||||
tsconfigRootDir: __dirname,
|
tsconfigRootDir: __dirname,
|
||||||
|
|||||||
@ -8,8 +8,8 @@
|
|||||||
"lint": "TIMING=1 eslint \"**/*.ts*\""
|
"lint": "TIMING=1 eslint \"**/*.ts*\""
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^8.43.0",
|
"@vchikalkin/eslint-config-awesome": "^1.1.1",
|
||||||
"eslint-config-custom": "*"
|
"eslint": "^8.46.0"
|
||||||
},
|
},
|
||||||
"dependencies": {}
|
"dependencies": {}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
root: true,
|
root: true,
|
||||||
extends: ['custom', 'custom/rules'],
|
extends: [
|
||||||
|
'@vchikalkin/eslint-config-awesome/react-typescript/config',
|
||||||
|
'@vchikalkin/eslint-config-awesome/react-typescript/rules',
|
||||||
|
],
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
project: './tsconfig.json',
|
project: './tsconfig.json',
|
||||||
tsconfigRootDir: __dirname,
|
tsconfigRootDir: __dirname,
|
||||||
|
|||||||
@ -12,8 +12,8 @@
|
|||||||
"@types/react-dom": "^18.2.6",
|
"@types/react-dom": "^18.2.6",
|
||||||
"@types/rebass": "^4.0.10",
|
"@types/rebass": "^4.0.10",
|
||||||
"@types/styled-components": "^5.1.26",
|
"@types/styled-components": "^5.1.26",
|
||||||
"eslint": "^8.43.0",
|
"@vchikalkin/eslint-config-awesome": "^1.1.1",
|
||||||
"eslint-config-custom": "*",
|
"eslint": "^8.46.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"tsconfig": "*",
|
"tsconfig": "*",
|
||||||
"typescript": "^4.9.5"
|
"typescript": "^4.9.5"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user