@kasoa/eslint-config 0.0.25 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/base/sonarjs.d.ts.map +1 -1
- package/dist/src/base/sonarjs.js +1 -0
- package/package.json +12 -13
- package/src/base/eslint.ts +0 -23
- package/src/base/import-lite.ts +0 -9
- package/src/base/index.ts +0 -28
- package/src/base/perfectionist.ts +0 -55
- package/src/base/regexp.ts +0 -6
- package/src/base/sonarjs.ts +0 -26
- package/src/base/typescript-eslint.ts +0 -54
- package/src/base/unicorn-x.ts +0 -10
- package/src/base/unused-imports.ts +0 -12
- package/src/base/vitest.ts +0 -7
- package/src/node/index.ts +0 -5
- package/src/node/n.ts +0 -12
- package/src/react/eslint-react.ts +0 -12
- package/src/react/index.ts +0 -18
- package/src/react/jsx-a11y.ts +0 -7
- package/src/react/react-hooks.ts +0 -7
- package/src/react/react-refresh.ts +0 -7
- package/src/react/react-you-might-not-need-an-effect.ts +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sonarjs.d.ts","sourceRoot":"","sources":["../../../src/base/sonarjs.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"sonarjs.d.ts","sourceRoot":"","sources":["../../../src/base/sonarjs.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa,kCAqBxB,CAAC"}
|
package/dist/src/base/sonarjs.js
CHANGED
|
@@ -17,6 +17,7 @@ export const sonarjsConfig = defineConfig({
|
|
|
17
17
|
"sonarjs/assertions-in-tests": "error",
|
|
18
18
|
"sonarjs/no-incomplete-assertions": "error",
|
|
19
19
|
"sonarjs/no-skipped-tests": "error",
|
|
20
|
+
// eslint-disable-next-line sonarjs/no-hardcoded-passwords -- rule identifier contains the word "password"
|
|
20
21
|
"sonarjs/no-hardcoded-passwords": "error",
|
|
21
22
|
"sonarjs/no-hardcoded-ip": "error",
|
|
22
23
|
"sonarjs/code-eval": "error",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kasoa/eslint-config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.26",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Kasoa's ESLint config",
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
"url": "https://github.com/emmanuelchucks/kasoa/issues"
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
27
|
-
"src",
|
|
28
27
|
"dist"
|
|
29
28
|
],
|
|
30
29
|
"exports": {
|
|
@@ -36,31 +35,31 @@
|
|
|
36
35
|
"access": "public"
|
|
37
36
|
},
|
|
38
37
|
"dependencies": {
|
|
39
|
-
"@eslint-react/eslint-plugin": "^2.
|
|
38
|
+
"@eslint-react/eslint-plugin": "^2.12.4",
|
|
40
39
|
"@eslint/js": "latest",
|
|
41
|
-
"@vitest/eslint-plugin": "^1.6.
|
|
40
|
+
"@vitest/eslint-plugin": "^1.6.7",
|
|
42
41
|
"eslint": "^9.39.2",
|
|
43
42
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
44
43
|
"eslint-config-prettier": "^10.1.8",
|
|
45
|
-
"eslint-plugin-import-lite": "
|
|
44
|
+
"eslint-plugin-import-lite": "0.5.0",
|
|
46
45
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
47
46
|
"eslint-plugin-jsx-a11y-x": "^0.1.1",
|
|
48
47
|
"eslint-plugin-n": "^17.23.2",
|
|
49
|
-
"eslint-plugin-perfectionist": "^5.
|
|
48
|
+
"eslint-plugin-perfectionist": "^5.5.0",
|
|
50
49
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
51
|
-
"eslint-plugin-react-refresh": "^0.
|
|
50
|
+
"eslint-plugin-react-refresh": "^0.5.0",
|
|
52
51
|
"eslint-plugin-react-you-might-not-need-an-effect": "^0.8.5",
|
|
53
52
|
"eslint-plugin-regexp": "^3.0.0",
|
|
54
|
-
"eslint-plugin-sonarjs": "^3.0.
|
|
53
|
+
"eslint-plugin-sonarjs": "^3.0.7",
|
|
55
54
|
"eslint-plugin-unicorn-x": "^3.2.1",
|
|
56
|
-
"eslint-plugin-unused-imports": "^4.
|
|
57
|
-
"globals": "^17.
|
|
58
|
-
"typescript-eslint": "^8.
|
|
55
|
+
"eslint-plugin-unused-imports": "^4.4.1",
|
|
56
|
+
"globals": "^17.3.0",
|
|
57
|
+
"typescript-eslint": "^8.55.0"
|
|
59
58
|
},
|
|
60
59
|
"devDependencies": {
|
|
61
60
|
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
|
|
62
|
-
"@types/node": "^25.
|
|
63
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
61
|
+
"@types/node": "^25.2.3",
|
|
62
|
+
"@typescript/native-preview": "^7.0.0-dev.20260211.1",
|
|
64
63
|
"prettier": "^3.8.1",
|
|
65
64
|
"@kasoa/tsconfig": "0.0.0"
|
|
66
65
|
},
|
package/src/base/eslint.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import eslint from "@eslint/js";
|
|
2
|
-
import { defineConfig } from "eslint/config";
|
|
3
|
-
|
|
4
|
-
export const eslintConfig = defineConfig(eslint.configs.recommended, {
|
|
5
|
-
rules: {
|
|
6
|
-
curly: ["error", "multi-line", "consistent"],
|
|
7
|
-
"default-case-last": "error",
|
|
8
|
-
eqeqeq: "error",
|
|
9
|
-
"grouped-accessor-pairs": ["error", "getBeforeSet"],
|
|
10
|
-
"logical-assignment-operators": ["error", "always"],
|
|
11
|
-
"max-params": "warn",
|
|
12
|
-
"no-alert": "error",
|
|
13
|
-
"no-console": ["warn", { allow: ["info", "warn", "error"] }],
|
|
14
|
-
"no-constructor-return": "error",
|
|
15
|
-
"no-else-return": ["error", { allowElseIf: false }],
|
|
16
|
-
"no-param-reassign": ["error", { props: false }],
|
|
17
|
-
"no-shadow": "off",
|
|
18
|
-
"no-unneeded-ternary": "error",
|
|
19
|
-
"no-useless-return": "error",
|
|
20
|
-
"object-shorthand": "error",
|
|
21
|
-
"prefer-template": "error",
|
|
22
|
-
},
|
|
23
|
-
});
|
package/src/base/import-lite.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import importLite from "eslint-plugin-import-lite";
|
|
2
|
-
import { defineConfig } from "eslint/config";
|
|
3
|
-
|
|
4
|
-
export const importLiteConfig = defineConfig(importLite.configs.recommended, {
|
|
5
|
-
rules: {
|
|
6
|
-
"import-lite/consistent-type-specifier-style": ["error", "top-level"],
|
|
7
|
-
"import-lite/newline-after-import": "error",
|
|
8
|
-
},
|
|
9
|
-
});
|
package/src/base/index.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import gitignore from "eslint-config-flat-gitignore";
|
|
2
|
-
import eslintConfigPrettier from "eslint-config-prettier/flat";
|
|
3
|
-
import { defineConfig, globalIgnores } from "eslint/config";
|
|
4
|
-
import { eslintConfig } from "./eslint.js";
|
|
5
|
-
import { importLiteConfig } from "./import-lite.js";
|
|
6
|
-
import { perfectionistConfig } from "./perfectionist.js";
|
|
7
|
-
import { regexpConfig } from "./regexp.js";
|
|
8
|
-
import { sonarjsConfig } from "./sonarjs.js";
|
|
9
|
-
import { typescriptEslintConfig } from "./typescript-eslint.js";
|
|
10
|
-
import { unicornXConfig } from "./unicorn-x.js";
|
|
11
|
-
import { unusedImportsConfig } from "./unused-imports.js";
|
|
12
|
-
import { vitestConfig } from "./vitest.js";
|
|
13
|
-
|
|
14
|
-
export const base = defineConfig(
|
|
15
|
-
gitignore(),
|
|
16
|
-
globalIgnores(["**/*.d.ts"]),
|
|
17
|
-
eslintConfig,
|
|
18
|
-
typescriptEslintConfig,
|
|
19
|
-
|
|
20
|
-
unicornXConfig,
|
|
21
|
-
vitestConfig,
|
|
22
|
-
importLiteConfig,
|
|
23
|
-
unusedImportsConfig,
|
|
24
|
-
perfectionistConfig,
|
|
25
|
-
sonarjsConfig,
|
|
26
|
-
regexpConfig,
|
|
27
|
-
eslintConfigPrettier,
|
|
28
|
-
);
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import perfectionist from "eslint-plugin-perfectionist";
|
|
2
|
-
import { defineConfig } from "eslint/config";
|
|
3
|
-
|
|
4
|
-
const baseConfig = {
|
|
5
|
-
order: "asc" as const,
|
|
6
|
-
type: "natural" as const,
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const perfectionistConfig = defineConfig({
|
|
10
|
-
plugins: { perfectionist },
|
|
11
|
-
rules: {
|
|
12
|
-
"perfectionist/sort-imports": [
|
|
13
|
-
"error",
|
|
14
|
-
{
|
|
15
|
-
...baseConfig,
|
|
16
|
-
newlinesBetween: 0,
|
|
17
|
-
groups: [
|
|
18
|
-
"type-import",
|
|
19
|
-
["type-parent", "type-sibling", "type-index", "type-internal"],
|
|
20
|
-
"value-builtin",
|
|
21
|
-
"value-external",
|
|
22
|
-
"value-internal",
|
|
23
|
-
["value-parent", "value-sibling", "value-index"],
|
|
24
|
-
"value-side-effect",
|
|
25
|
-
"unknown",
|
|
26
|
-
],
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
"perfectionist/sort-named-imports": ["error", baseConfig],
|
|
30
|
-
"perfectionist/sort-interfaces": ["error", baseConfig],
|
|
31
|
-
"perfectionist/sort-object-types": ["error", baseConfig],
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
export const perfectionistJsxConfig = defineConfig({
|
|
36
|
-
plugins: { perfectionist },
|
|
37
|
-
rules: {
|
|
38
|
-
"perfectionist/sort-jsx-props": [
|
|
39
|
-
"error",
|
|
40
|
-
{
|
|
41
|
-
...baseConfig,
|
|
42
|
-
customGroups: [
|
|
43
|
-
{ elementNamePattern: "^key$", groupName: "key" },
|
|
44
|
-
{ elementNamePattern: "^ref$", groupName: "ref" },
|
|
45
|
-
{ elementNamePattern: "^on[A-Z]", groupName: "callback" },
|
|
46
|
-
{
|
|
47
|
-
elementNamePattern: "(?:^className$|ClassName$)",
|
|
48
|
-
groupName: "className",
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
groups: ["key", "ref", "unknown", "callback", "className"],
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
},
|
|
55
|
-
});
|
package/src/base/regexp.ts
DELETED
package/src/base/sonarjs.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import sonarjs from "eslint-plugin-sonarjs";
|
|
2
|
-
import { defineConfig } from "eslint/config";
|
|
3
|
-
|
|
4
|
-
const COGNITIVE_COMPLEXITY_THRESHOLD = 15;
|
|
5
|
-
|
|
6
|
-
export const sonarjsConfig = defineConfig({
|
|
7
|
-
plugins: { sonarjs },
|
|
8
|
-
rules: {
|
|
9
|
-
"sonarjs/cognitive-complexity": ["warn", COGNITIVE_COMPLEXITY_THRESHOLD],
|
|
10
|
-
"sonarjs/no-identical-expressions": "error",
|
|
11
|
-
"sonarjs/no-identical-conditions": "error",
|
|
12
|
-
"sonarjs/no-duplicated-branches": "error",
|
|
13
|
-
"sonarjs/no-nested-conditional": "error",
|
|
14
|
-
"sonarjs/no-gratuitous-expressions": "error",
|
|
15
|
-
"sonarjs/no-invariant-returns": "error",
|
|
16
|
-
"sonarjs/no-alphabetical-sort": "error",
|
|
17
|
-
"sonarjs/different-types-comparison": "error",
|
|
18
|
-
"sonarjs/no-nested-functions": "error",
|
|
19
|
-
"sonarjs/assertions-in-tests": "error",
|
|
20
|
-
"sonarjs/no-incomplete-assertions": "error",
|
|
21
|
-
"sonarjs/no-skipped-tests": "error",
|
|
22
|
-
"sonarjs/no-hardcoded-passwords": "error",
|
|
23
|
-
"sonarjs/no-hardcoded-ip": "error",
|
|
24
|
-
"sonarjs/code-eval": "error",
|
|
25
|
-
},
|
|
26
|
-
});
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { Linter } from "eslint";
|
|
2
|
-
import { defineConfig } from "eslint/config";
|
|
3
|
-
import globals from "globals";
|
|
4
|
-
import typescriptEslint from "typescript-eslint";
|
|
5
|
-
|
|
6
|
-
const sharedConfig = {
|
|
7
|
-
extends: [
|
|
8
|
-
typescriptEslint.configs.strictTypeChecked,
|
|
9
|
-
typescriptEslint.configs.stylisticTypeChecked,
|
|
10
|
-
],
|
|
11
|
-
parserOptions: {
|
|
12
|
-
projectService: true,
|
|
13
|
-
},
|
|
14
|
-
rules: {
|
|
15
|
-
"@typescript-eslint/consistent-type-imports": "error",
|
|
16
|
-
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
17
|
-
"@typescript-eslint/no-shadow": "error",
|
|
18
|
-
"@typescript-eslint/no-unused-vars": "off",
|
|
19
|
-
"@typescript-eslint/prefer-readonly": "error",
|
|
20
|
-
"@typescript-eslint/require-array-sort-compare": "error",
|
|
21
|
-
"@typescript-eslint/switch-exhaustiveness-check": "error",
|
|
22
|
-
"no-shadow": "off",
|
|
23
|
-
"@typescript-eslint/consistent-type-exports": [
|
|
24
|
-
"error",
|
|
25
|
-
{ fixMixedExportsWithInlineTypeSpecifier: true },
|
|
26
|
-
],
|
|
27
|
-
} satisfies Linter.RulesRecord,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const typescriptEslintConfig = defineConfig(
|
|
31
|
-
{
|
|
32
|
-
extends: sharedConfig.extends,
|
|
33
|
-
files: ["**/*.{js,jsx,mjs,ts,tsx,mts}"],
|
|
34
|
-
rules: sharedConfig.rules,
|
|
35
|
-
languageOptions: {
|
|
36
|
-
parserOptions: sharedConfig.parserOptions,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
extends: sharedConfig.extends,
|
|
41
|
-
files: ["**/*.{cjs,cts}"],
|
|
42
|
-
languageOptions: {
|
|
43
|
-
parserOptions: sharedConfig.parserOptions,
|
|
44
|
-
sourceType: "commonjs",
|
|
45
|
-
globals: {
|
|
46
|
-
...globals.node,
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
rules: {
|
|
50
|
-
...sharedConfig.rules,
|
|
51
|
-
"@typescript-eslint/no-require-imports": "off",
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
);
|
package/src/base/unicorn-x.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import unicornX from "eslint-plugin-unicorn-x";
|
|
2
|
-
import { defineConfig } from "eslint/config";
|
|
3
|
-
|
|
4
|
-
export const unicornXConfig = defineConfig(unicornX.configs.recommended, {
|
|
5
|
-
rules: {
|
|
6
|
-
"unicorn-x/prefer-import-meta-properties": "error",
|
|
7
|
-
"unicorn-x/prevent-abbreviations": "off",
|
|
8
|
-
"unicorn-x/no-array-for-each": "error",
|
|
9
|
-
},
|
|
10
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import unusedImports from "eslint-plugin-unused-imports";
|
|
2
|
-
import { defineConfig } from "eslint/config";
|
|
3
|
-
|
|
4
|
-
export const unusedImportsConfig = defineConfig({
|
|
5
|
-
plugins: {
|
|
6
|
-
"unused-imports": unusedImports,
|
|
7
|
-
},
|
|
8
|
-
rules: {
|
|
9
|
-
"unused-imports/no-unused-imports": "error",
|
|
10
|
-
"unused-imports/no-unused-vars": "off",
|
|
11
|
-
},
|
|
12
|
-
});
|
package/src/base/vitest.ts
DELETED
package/src/node/index.ts
DELETED
package/src/node/n.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import nodePlugin from "eslint-plugin-n";
|
|
2
|
-
import { defineConfig } from "eslint/config";
|
|
3
|
-
|
|
4
|
-
export const nodeConfig = defineConfig(
|
|
5
|
-
nodePlugin.configs["flat/recommended-module"],
|
|
6
|
-
{
|
|
7
|
-
rules: {
|
|
8
|
-
"n/no-missing-import": "off",
|
|
9
|
-
"n/no-unpublished-import": "off",
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import eslintReact from "@eslint-react/eslint-plugin";
|
|
2
|
-
import { defineConfig } from "eslint/config";
|
|
3
|
-
|
|
4
|
-
export const eslintReactConfig = defineConfig({
|
|
5
|
-
...eslintReact.configs["strict-type-checked"],
|
|
6
|
-
files: ["**/*.{js,jsx,ts,tsx}"],
|
|
7
|
-
rules: {
|
|
8
|
-
...eslintReact.configs["strict-type-checked"].rules,
|
|
9
|
-
"@eslint-react/no-unstable-context-value": "off",
|
|
10
|
-
"@eslint-react/prefer-namespace-import": "error",
|
|
11
|
-
},
|
|
12
|
-
});
|
package/src/react/index.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "eslint/config";
|
|
2
|
-
import { base } from "../base/index.js";
|
|
3
|
-
import { perfectionistJsxConfig } from "../base/perfectionist.js";
|
|
4
|
-
import { eslintReactConfig } from "./eslint-react.js";
|
|
5
|
-
import { jsxA11yConfig } from "./jsx-a11y.js";
|
|
6
|
-
import { reactHooksConfig } from "./react-hooks.js";
|
|
7
|
-
import { reactRefreshConfig } from "./react-refresh.js";
|
|
8
|
-
import { reactYouMightNotNeedAnEffectConfig } from "./react-you-might-not-need-an-effect.js";
|
|
9
|
-
|
|
10
|
-
export const react = defineConfig(
|
|
11
|
-
base,
|
|
12
|
-
eslintReactConfig,
|
|
13
|
-
jsxA11yConfig,
|
|
14
|
-
reactHooksConfig,
|
|
15
|
-
reactRefreshConfig,
|
|
16
|
-
reactYouMightNotNeedAnEffectConfig,
|
|
17
|
-
perfectionistJsxConfig,
|
|
18
|
-
);
|
package/src/react/jsx-a11y.ts
DELETED
package/src/react/react-hooks.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import reactYouMightNotNeedAnEffect from "eslint-plugin-react-you-might-not-need-an-effect";
|
|
2
|
-
import { defineConfig } from "eslint/config";
|
|
3
|
-
|
|
4
|
-
export const reactYouMightNotNeedAnEffectConfig = defineConfig({
|
|
5
|
-
...reactYouMightNotNeedAnEffect.configs.recommended,
|
|
6
|
-
files: ["**/*.{js,jsx,ts,tsx}"],
|
|
7
|
-
});
|