@nijesmik/eslint-config 0.1.2 → 0.3.0
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/chunk-SZKMGGXH.js +120 -0
- package/dist/index.js +3 -114
- package/dist/next.d.ts +5 -0
- package/dist/next.js +31 -0
- package/package.json +10 -2
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// index.ts
|
|
2
|
+
import json from "@eslint/json";
|
|
3
|
+
import importPlugin from "eslint-plugin-import";
|
|
4
|
+
import perfectionist from "eslint-plugin-perfectionist";
|
|
5
|
+
import { Alphabet } from "eslint-plugin-perfectionist/alphabet";
|
|
6
|
+
import unusedImports from "eslint-plugin-unused-imports";
|
|
7
|
+
import { defineConfig } from "eslint/config";
|
|
8
|
+
import tseslint from "typescript-eslint";
|
|
9
|
+
var sortOptions = {
|
|
10
|
+
type: "unsorted",
|
|
11
|
+
groups: ["unknown", "method", "callback"],
|
|
12
|
+
customGroups: [
|
|
13
|
+
{
|
|
14
|
+
type: "unsorted",
|
|
15
|
+
groupName: "callback",
|
|
16
|
+
elementNamePattern: "^on[A-Z]"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
};
|
|
20
|
+
var index_default = defineConfig([
|
|
21
|
+
{
|
|
22
|
+
ignores: ["**/*.gen.ts", "**/dist/**"]
|
|
23
|
+
},
|
|
24
|
+
...tseslint.configs.recommended,
|
|
25
|
+
{
|
|
26
|
+
files: ["**/*.{ts,mts,cts,tsx}"],
|
|
27
|
+
languageOptions: {
|
|
28
|
+
parserOptions: {
|
|
29
|
+
tsconfigRootDir: process.cwd()
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
rules: {
|
|
33
|
+
"@typescript-eslint/no-unused-vars": [
|
|
34
|
+
"error",
|
|
35
|
+
{
|
|
36
|
+
argsIgnorePattern: "^_",
|
|
37
|
+
varsIgnorePattern: "^_",
|
|
38
|
+
caughtErrorsIgnorePattern: "^_"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
|
|
45
|
+
plugins: { perfectionist, import: importPlugin, "unused-imports": unusedImports },
|
|
46
|
+
rules: {
|
|
47
|
+
"eol-last": ["error", "always"],
|
|
48
|
+
"no-multiple-empty-lines": ["error", { max: 1, maxEOF: 1, maxBOF: 0 }],
|
|
49
|
+
"unused-imports/no-unused-imports": ["error", { "prefer-inline": false }]
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
|
|
54
|
+
ignores: ["**/*.config.{js,mjs,cjs,ts,mts,cts}"],
|
|
55
|
+
rules: {
|
|
56
|
+
...perfectionist.configs["recommended-alphabetical"].rules,
|
|
57
|
+
"perfectionist/sort-switch-case": "off",
|
|
58
|
+
"perfectionist/sort-classes": "off",
|
|
59
|
+
"perfectionist/sort-interfaces": ["error", sortOptions],
|
|
60
|
+
"perfectionist/sort-modules": "off",
|
|
61
|
+
"perfectionist/sort-jsx-props": "off",
|
|
62
|
+
"perfectionist/sort-exports": [
|
|
63
|
+
"error",
|
|
64
|
+
{
|
|
65
|
+
partitionByNewLine: true,
|
|
66
|
+
groups: ["unknown", "type-export"]
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"perfectionist/sort-objects": "off",
|
|
70
|
+
"perfectionist/sort-union-types": [
|
|
71
|
+
"error",
|
|
72
|
+
{
|
|
73
|
+
type: "unsorted",
|
|
74
|
+
groups: ["unknown", "nullish"]
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"perfectionist/sort-object-types": ["error", sortOptions],
|
|
78
|
+
"perfectionist/sort-intersection-types": [
|
|
79
|
+
"error",
|
|
80
|
+
{
|
|
81
|
+
type: "unsorted",
|
|
82
|
+
groups: ["named", "unknown"]
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"import/no-duplicates": ["error", { "prefer-inline": true }],
|
|
86
|
+
curly: ["error", "all"]
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
|
|
91
|
+
rules: {
|
|
92
|
+
"perfectionist/sort-named-imports": [
|
|
93
|
+
"error",
|
|
94
|
+
{
|
|
95
|
+
type: "custom",
|
|
96
|
+
alphabet: Alphabet.generateRecommendedAlphabet().sortByLocaleCompare("en-US").placeAllWithCaseBeforeAllWithOtherCase("lowercase").getCharacters(),
|
|
97
|
+
ignoreCase: false,
|
|
98
|
+
groups: ["value-import", { newlinesBetween: 0 }, "type-import"]
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
files: ["**/*.json"],
|
|
105
|
+
ignores: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
106
|
+
plugins: { json },
|
|
107
|
+
language: "json/json",
|
|
108
|
+
extends: ["json/recommended"]
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
112
|
+
plugins: { json },
|
|
113
|
+
language: "json/jsonc",
|
|
114
|
+
extends: ["json/recommended"]
|
|
115
|
+
}
|
|
116
|
+
]);
|
|
117
|
+
|
|
118
|
+
export {
|
|
119
|
+
index_default
|
|
120
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,117 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import perfectionist from "eslint-plugin-perfectionist";
|
|
5
|
-
import unusedImports from "eslint-plugin-unused-imports";
|
|
6
|
-
import { Alphabet } from "eslint-plugin-perfectionist/alphabet";
|
|
7
|
-
import { defineConfig } from "eslint/config";
|
|
8
|
-
import tseslint from "typescript-eslint";
|
|
9
|
-
var sortOptions = {
|
|
10
|
-
type: "unsorted",
|
|
11
|
-
groups: ["unknown", "method", "callback"],
|
|
12
|
-
customGroups: [
|
|
13
|
-
{
|
|
14
|
-
type: "unsorted",
|
|
15
|
-
groupName: "callback",
|
|
16
|
-
elementNamePattern: "^on[A-Z]"
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
};
|
|
20
|
-
var index_default = defineConfig([
|
|
21
|
-
{
|
|
22
|
-
ignores: ["**/*.gen.ts", "**/dist/**"]
|
|
23
|
-
},
|
|
24
|
-
...tseslint.configs.recommended,
|
|
25
|
-
{
|
|
26
|
-
files: ["**/*.{ts,mts,cts,tsx}"],
|
|
27
|
-
languageOptions: {
|
|
28
|
-
parserOptions: {
|
|
29
|
-
tsconfigRootDir: process.cwd()
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
rules: {
|
|
33
|
-
"@typescript-eslint/no-unused-vars": [
|
|
34
|
-
"error",
|
|
35
|
-
{
|
|
36
|
-
argsIgnorePattern: "^_",
|
|
37
|
-
varsIgnorePattern: "^_",
|
|
38
|
-
caughtErrorsIgnorePattern: "^_"
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
|
|
45
|
-
plugins: { perfectionist, import: importPlugin, "unused-imports": unusedImports },
|
|
46
|
-
rules: {
|
|
47
|
-
"eol-last": ["error", "always"],
|
|
48
|
-
"no-multiple-empty-lines": ["error", { max: 1, maxEOF: 1, maxBOF: 0 }],
|
|
49
|
-
"unused-imports/no-unused-imports": "error"
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
files: ["src/**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
|
|
54
|
-
rules: {
|
|
55
|
-
...perfectionist.configs["recommended-alphabetical"].rules,
|
|
56
|
-
"perfectionist/sort-switch-case": "off",
|
|
57
|
-
"perfectionist/sort-classes": "off",
|
|
58
|
-
"perfectionist/sort-interfaces": ["error", sortOptions],
|
|
59
|
-
"perfectionist/sort-modules": "off",
|
|
60
|
-
"perfectionist/sort-jsx-props": "off",
|
|
61
|
-
"perfectionist/sort-exports": [
|
|
62
|
-
"error",
|
|
63
|
-
{
|
|
64
|
-
partitionByNewLine: true,
|
|
65
|
-
groups: ["unknown", "type-export"]
|
|
66
|
-
}
|
|
67
|
-
],
|
|
68
|
-
"perfectionist/sort-objects": "off",
|
|
69
|
-
"perfectionist/sort-union-types": [
|
|
70
|
-
"error",
|
|
71
|
-
{
|
|
72
|
-
type: "unsorted",
|
|
73
|
-
groups: ["unknown", "nullish"]
|
|
74
|
-
}
|
|
75
|
-
],
|
|
76
|
-
"perfectionist/sort-object-types": ["error", sortOptions],
|
|
77
|
-
"perfectionist/sort-intersection-types": [
|
|
78
|
-
"error",
|
|
79
|
-
{
|
|
80
|
-
groups: ["named", "unknown"]
|
|
81
|
-
}
|
|
82
|
-
],
|
|
83
|
-
"import/no-duplicates": ["error", { "prefer-inline": true }],
|
|
84
|
-
curly: ["error", "all"]
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
|
|
89
|
-
rules: {
|
|
90
|
-
"perfectionist/sort-named-imports": [
|
|
91
|
-
"error",
|
|
92
|
-
{
|
|
93
|
-
type: "custom",
|
|
94
|
-
alphabet: Alphabet.generateRecommendedAlphabet().sortByLocaleCompare("en-US").placeAllWithCaseBeforeAllWithOtherCase("lowercase").getCharacters(),
|
|
95
|
-
ignoreCase: false,
|
|
96
|
-
groups: ["value-import", { newlinesBetween: 0 }, "type-import"]
|
|
97
|
-
}
|
|
98
|
-
]
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
files: ["**/*.json"],
|
|
103
|
-
ignores: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
104
|
-
plugins: { json },
|
|
105
|
-
language: "json/json",
|
|
106
|
-
extends: ["json/recommended"]
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
110
|
-
plugins: { json },
|
|
111
|
-
language: "json/jsonc",
|
|
112
|
-
extends: ["json/recommended"]
|
|
113
|
-
}
|
|
114
|
-
]);
|
|
1
|
+
import {
|
|
2
|
+
index_default
|
|
3
|
+
} from "./chunk-SZKMGGXH.js";
|
|
115
4
|
export {
|
|
116
5
|
index_default as default
|
|
117
6
|
};
|
package/dist/next.d.ts
ADDED
package/dist/next.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
index_default
|
|
3
|
+
} from "./chunk-SZKMGGXH.js";
|
|
4
|
+
|
|
5
|
+
// next.ts
|
|
6
|
+
import nextPlugin from "@next/eslint-plugin-next";
|
|
7
|
+
import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
8
|
+
import reactHooks from "eslint-plugin-react-hooks";
|
|
9
|
+
import { defineConfig } from "eslint/config";
|
|
10
|
+
var next_default = defineConfig([
|
|
11
|
+
...index_default,
|
|
12
|
+
// Following eslint-config-next/typescript
|
|
13
|
+
{ ignores: [".next/**", "out/**", "build/**", "next-env.d.ts"] },
|
|
14
|
+
nextPlugin.configs["core-web-vitals"],
|
|
15
|
+
reactHooks.configs.flat["recommended-latest"],
|
|
16
|
+
jsxA11y.flatConfigs.recommended,
|
|
17
|
+
{
|
|
18
|
+
rules: {
|
|
19
|
+
"react-hooks/exhaustive-deps": "off",
|
|
20
|
+
"jsx-a11y/alt-text": ["warn", { elements: ["img"], img: ["Image"] }]
|
|
21
|
+
},
|
|
22
|
+
settings: {
|
|
23
|
+
"import/resolver": {
|
|
24
|
+
typescript: true
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
]);
|
|
29
|
+
export {
|
|
30
|
+
next_default as default
|
|
31
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nijesmik/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
".": {
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"import": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./next": {
|
|
13
|
+
"types": "./dist/next.d.ts",
|
|
14
|
+
"import": "./dist/next.js"
|
|
11
15
|
}
|
|
12
16
|
},
|
|
13
17
|
"files": [
|
|
@@ -15,8 +19,12 @@
|
|
|
15
19
|
],
|
|
16
20
|
"dependencies": {
|
|
17
21
|
"@eslint/json": "^0.14.0",
|
|
22
|
+
"@next/eslint-plugin-next": "^16.2.6",
|
|
23
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
18
24
|
"eslint-plugin-import": "^2.32.0",
|
|
25
|
+
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
19
26
|
"eslint-plugin-perfectionist": "^5.4.0",
|
|
27
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
20
28
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
21
29
|
"typescript-eslint": "^8.46.4"
|
|
22
30
|
},
|
|
@@ -28,6 +36,6 @@
|
|
|
28
36
|
"eslint": "^9.39.1"
|
|
29
37
|
},
|
|
30
38
|
"scripts": {
|
|
31
|
-
"build": "tsup index.ts --format esm --dts"
|
|
39
|
+
"build": "tsup index.ts next.ts --format esm --dts"
|
|
32
40
|
}
|
|
33
41
|
}
|