@nijesmik/eslint-config 0.1.0 → 0.1.2
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/index.d.ts +5 -0
- package/{index.ts → dist/index.js} +36 -59
- package/package.json +11 -3
package/dist/index.d.ts
ADDED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// index.ts
|
|
1
2
|
import json from "@eslint/json";
|
|
2
3
|
import importPlugin from "eslint-plugin-import";
|
|
3
4
|
import perfectionist from "eslint-plugin-perfectionist";
|
|
@@ -5,30 +6,28 @@ import unusedImports from "eslint-plugin-unused-imports";
|
|
|
5
6
|
import { Alphabet } from "eslint-plugin-perfectionist/alphabet";
|
|
6
7
|
import { defineConfig } from "eslint/config";
|
|
7
8
|
import tseslint from "typescript-eslint";
|
|
8
|
-
|
|
9
|
-
const sortOptions = {
|
|
9
|
+
var sortOptions = {
|
|
10
10
|
type: "unsorted",
|
|
11
11
|
groups: ["unknown", "method", "callback"],
|
|
12
12
|
customGroups: [
|
|
13
13
|
{
|
|
14
14
|
type: "unsorted",
|
|
15
15
|
groupName: "callback",
|
|
16
|
-
elementNamePattern: "^on[A-Z]"
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export default defineConfig([
|
|
16
|
+
elementNamePattern: "^on[A-Z]"
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
};
|
|
20
|
+
var index_default = defineConfig([
|
|
22
21
|
{
|
|
23
|
-
ignores: ["**/*.gen.ts", "**/dist/**"]
|
|
22
|
+
ignores: ["**/*.gen.ts", "**/dist/**"]
|
|
24
23
|
},
|
|
25
24
|
...tseslint.configs.recommended,
|
|
26
25
|
{
|
|
27
26
|
files: ["**/*.{ts,mts,cts,tsx}"],
|
|
28
27
|
languageOptions: {
|
|
29
28
|
parserOptions: {
|
|
30
|
-
tsconfigRootDir: process.cwd()
|
|
31
|
-
}
|
|
29
|
+
tsconfigRootDir: process.cwd()
|
|
30
|
+
}
|
|
32
31
|
},
|
|
33
32
|
rules: {
|
|
34
33
|
"@typescript-eslint/no-unused-vars": [
|
|
@@ -36,10 +35,10 @@ export default defineConfig([
|
|
|
36
35
|
{
|
|
37
36
|
argsIgnorePattern: "^_",
|
|
38
37
|
varsIgnorePattern: "^_",
|
|
39
|
-
caughtErrorsIgnorePattern: "^_"
|
|
40
|
-
}
|
|
41
|
-
]
|
|
42
|
-
}
|
|
38
|
+
caughtErrorsIgnorePattern: "^_"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
43
42
|
},
|
|
44
43
|
{
|
|
45
44
|
files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
|
|
@@ -47,8 +46,8 @@ export default defineConfig([
|
|
|
47
46
|
rules: {
|
|
48
47
|
"eol-last": ["error", "always"],
|
|
49
48
|
"no-multiple-empty-lines": ["error", { max: 1, maxEOF: 1, maxBOF: 0 }],
|
|
50
|
-
"unused-imports/no-unused-imports": "error"
|
|
51
|
-
}
|
|
49
|
+
"unused-imports/no-unused-imports": "error"
|
|
50
|
+
}
|
|
52
51
|
},
|
|
53
52
|
{
|
|
54
53
|
files: ["src/**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
|
|
@@ -63,49 +62,27 @@ export default defineConfig([
|
|
|
63
62
|
"error",
|
|
64
63
|
{
|
|
65
64
|
partitionByNewLine: true,
|
|
66
|
-
groups: ["unknown", "type-export"]
|
|
67
|
-
}
|
|
68
|
-
],
|
|
69
|
-
"perfectionist/sort-objects": [
|
|
70
|
-
"error",
|
|
71
|
-
{
|
|
72
|
-
type: "unsorted",
|
|
73
|
-
useConfigurationIf: {
|
|
74
|
-
objectType: "non-destructured",
|
|
75
|
-
},
|
|
76
|
-
},
|
|
65
|
+
groups: ["unknown", "type-export"]
|
|
66
|
+
}
|
|
77
67
|
],
|
|
68
|
+
"perfectionist/sort-objects": "off",
|
|
78
69
|
"perfectionist/sort-union-types": [
|
|
79
70
|
"error",
|
|
80
71
|
{
|
|
81
72
|
type: "unsorted",
|
|
82
|
-
groups: ["unknown", "nullish"]
|
|
83
|
-
}
|
|
73
|
+
groups: ["unknown", "nullish"]
|
|
74
|
+
}
|
|
84
75
|
],
|
|
85
76
|
"perfectionist/sort-object-types": ["error", sortOptions],
|
|
86
77
|
"perfectionist/sort-intersection-types": [
|
|
87
78
|
"error",
|
|
88
79
|
{
|
|
89
|
-
groups: ["named", "unknown"]
|
|
90
|
-
}
|
|
91
|
-
],
|
|
92
|
-
"perfectionist/sort-imports": [
|
|
93
|
-
"error",
|
|
94
|
-
{
|
|
95
|
-
type: "alphabetical",
|
|
96
|
-
groups: [
|
|
97
|
-
["type-import", "type-internal", "type-parent", "type-sibling", "type-index"],
|
|
98
|
-
["value-builtin", "value-external"],
|
|
99
|
-
"value-internal",
|
|
100
|
-
["value-parent", "value-sibling", "value-index"],
|
|
101
|
-
"ts-equals-import",
|
|
102
|
-
"unknown",
|
|
103
|
-
],
|
|
104
|
-
},
|
|
80
|
+
groups: ["named", "unknown"]
|
|
81
|
+
}
|
|
105
82
|
],
|
|
106
83
|
"import/no-duplicates": ["error", { "prefer-inline": true }],
|
|
107
|
-
curly: ["error", "all"]
|
|
108
|
-
}
|
|
84
|
+
curly: ["error", "all"]
|
|
85
|
+
}
|
|
109
86
|
},
|
|
110
87
|
{
|
|
111
88
|
files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
|
|
@@ -114,27 +91,27 @@ export default defineConfig([
|
|
|
114
91
|
"error",
|
|
115
92
|
{
|
|
116
93
|
type: "custom",
|
|
117
|
-
alphabet: Alphabet.generateRecommendedAlphabet()
|
|
118
|
-
.sortByLocaleCompare("en-US")
|
|
119
|
-
.placeAllWithCaseBeforeAllWithOtherCase("lowercase")
|
|
120
|
-
.getCharacters(),
|
|
94
|
+
alphabet: Alphabet.generateRecommendedAlphabet().sortByLocaleCompare("en-US").placeAllWithCaseBeforeAllWithOtherCase("lowercase").getCharacters(),
|
|
121
95
|
ignoreCase: false,
|
|
122
|
-
groups: ["value-import", { newlinesBetween: 0 }, "type-import"]
|
|
123
|
-
}
|
|
124
|
-
]
|
|
125
|
-
}
|
|
96
|
+
groups: ["value-import", { newlinesBetween: 0 }, "type-import"]
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
}
|
|
126
100
|
},
|
|
127
101
|
{
|
|
128
102
|
files: ["**/*.json"],
|
|
129
103
|
ignores: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
130
104
|
plugins: { json },
|
|
131
105
|
language: "json/json",
|
|
132
|
-
extends: ["json/recommended"]
|
|
106
|
+
extends: ["json/recommended"]
|
|
133
107
|
},
|
|
134
108
|
{
|
|
135
109
|
files: ["**/tsconfig.json", "**/tsconfig.*.json"],
|
|
136
110
|
plugins: { json },
|
|
137
111
|
language: "json/jsonc",
|
|
138
|
-
extends: ["json/recommended"]
|
|
139
|
-
}
|
|
112
|
+
extends: ["json/recommended"]
|
|
113
|
+
}
|
|
140
114
|
]);
|
|
115
|
+
export {
|
|
116
|
+
index_default as default
|
|
117
|
+
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nijesmik/eslint-config",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
5
7
|
"exports": {
|
|
6
|
-
".":
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js"
|
|
11
|
+
}
|
|
7
12
|
},
|
|
8
13
|
"files": [
|
|
9
|
-
"
|
|
14
|
+
"dist"
|
|
10
15
|
],
|
|
11
16
|
"dependencies": {
|
|
12
17
|
"@eslint/json": "^0.14.0",
|
|
@@ -21,5 +26,8 @@
|
|
|
21
26
|
"devDependencies": {
|
|
22
27
|
"@types/node": "^25.3.0",
|
|
23
28
|
"eslint": "^9.39.1"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsup index.ts --format esm --dts"
|
|
24
32
|
}
|
|
25
33
|
}
|