feat: ci complexity linters (#236)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { defineConfig, globalIgnores } from "eslint/config";
|
||||
import nextVitals from "eslint-config-next/core-web-vitals";
|
||||
import nextTs from "eslint-config-next/typescript";
|
||||
import sonarjs from "eslint-plugin-sonarjs";
|
||||
import unusedImports from "eslint-plugin-unused-imports";
|
||||
|
||||
const eslintConfig = defineConfig([
|
||||
...nextVitals,
|
||||
@@ -13,6 +15,24 @@ const eslintConfig = defineConfig([
|
||||
"build/**",
|
||||
"next-env.d.ts",
|
||||
]),
|
||||
{
|
||||
plugins: {
|
||||
sonarjs,
|
||||
"unused-imports": unusedImports,
|
||||
},
|
||||
rules: {
|
||||
"max-lines": ["warn", { max: 600, skipBlankLines: true, skipComments: true }],
|
||||
"max-lines-per-function": ["warn", { max: 100, skipBlankLines: true, skipComments: true }],
|
||||
"complexity": ["warn", 15],
|
||||
"max-depth": ["warn", 4],
|
||||
"max-params": ["warn", 5],
|
||||
"no-nested-ternary": "warn",
|
||||
"sonarjs/cognitive-complexity": ["warn", 20],
|
||||
"sonarjs/no-duplicate-string": ["warn", { threshold: 4 }],
|
||||
"sonarjs/no-identical-functions": "warn",
|
||||
"unused-imports/no-unused-imports": "warn",
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
export default eslintConfig;
|
||||
|
||||
Reference in New Issue
Block a user