linted 13.0.1 → 13.0.3
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/README.md +37 -47
- package/package.json +2 -2
package/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# [linted](https://npmjs.com/package/linted)
|
1
|
+
# [linted](https://npmjs.com/package/linted) v13
|
2
2
|
|
3
3
|
Zero-config [**ESLint**](https://eslint.org/) flat config factory for (strict, agglutinative) entire-stack formatting and linting: TypeScript, JavaScript, Svelte, HTML, (Tailwind) CSS, Jest, JSON(C), and sadly YAML.
|
4
4
|
|
@@ -36,38 +36,40 @@ Zero-config [**ESLint**](https://eslint.org/) flat config factory for (strict, a
|
|
36
36
|
```javascript
|
37
37
|
import linted from "linted";
|
38
38
|
|
39
|
-
export default
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
]
|
39
|
+
export default new linted(
|
40
|
+
{ // Scope (i.e. files to lint)
|
41
|
+
js: [
|
42
|
+
"eslint.config.js",
|
43
|
+
"svelte.config.js",
|
44
|
+
],
|
45
|
+
ts: [
|
46
|
+
"src/**/*.ts",
|
47
|
+
"vite.config.ts",
|
48
|
+
],
|
49
|
+
svelte: ["src/**/*.svelte"],
|
50
|
+
// ...
|
51
|
+
},
|
52
|
+
);
|
49
53
|
```
|
50
54
|
|
51
55
|
### Full Control via *Per-Scope* Override
|
52
56
|
|
53
57
|
```javascript
|
54
|
-
|
58
|
+
// ...Scope (i.e. files to lint)
|
59
|
+
},
|
60
|
+
{ // Optional: Override
|
61
|
+
overrideTs: {
|
62
|
+
// Turns it off in "ts" scope,
|
63
|
+
// but NOT in "js" scope,
|
64
|
+
// NOR in "svelte" scope.
|
65
|
+
"no-unused-vars": "off", // JS base rule
|
66
|
+
// "@typescript-eslint/ ..., or TS plugin rule
|
55
67
|
},
|
56
|
-
|
57
|
-
|
58
|
-
// Turns it off in "ts" scope,
|
59
|
-
// but NOT in "js" scope,
|
60
|
-
// NOR in "svelte" scope.
|
61
|
-
"no-unused-vars": "off", // JS base rule
|
62
|
-
// "@typescript-eslint/ ..., or TS plugin rule
|
63
|
-
},
|
64
|
-
overrideSvelte: {
|
65
|
-
// ... JS, TS, or Svelte plugin rules
|
66
|
-
},
|
68
|
+
overrideSvelte: {
|
69
|
+
// ... JS, TS, or Svelte plugin rules
|
67
70
|
},
|
68
|
-
|
69
|
-
|
70
|
-
];
|
71
|
+
},
|
72
|
+
);
|
71
73
|
```
|
72
74
|
|
73
75
|
### Zero-Dependency
|
@@ -127,22 +129,24 @@ If linting `TypeScript` files, [`skipLibCheck`](https://www.typescriptlang.org/t
|
|
127
129
|
1. Install [`eslint`](https://npmjs.com/package/eslint) and [`linted`](https://npmjs.com/package/linted)
|
128
130
|
|
129
131
|
```bash
|
130
|
-
npm i -D eslint@^8.57 linted@^
|
132
|
+
npm i -D eslint@^8.57 linted@^13
|
131
133
|
```
|
132
134
|
|
133
135
|
1. Create `eslint.config.js` in your root directory.
|
134
136
|
|
135
137
|
1. In `eslint.config.js`:
|
136
|
-
- Import `linted`.
|
138
|
+
- Import `function` `linted`.
|
137
139
|
|
138
140
|
```javascript
|
139
141
|
import linted from "linted";
|
140
142
|
```
|
141
143
|
|
142
|
-
-
|
144
|
+
- Export `linted` with arguments:
|
143
145
|
|
144
146
|
```javascript
|
145
|
-
|
147
|
+
import linted from "linted";
|
148
|
+
|
149
|
+
export default linted(
|
146
150
|
{ // Scope (i.e. files to lint)
|
147
151
|
js: ["*.config.js"], // glob pattern array
|
148
152
|
ts: ["*.config.ts", "src/**/*.ts"],
|
@@ -161,21 +165,7 @@ If linting `TypeScript` files, [`skipLibCheck`](https://www.typescriptlang.org/t
|
|
161
165
|
// overrideHtml, overrideCss, overrideJsonc,
|
162
166
|
// overrideJson, overrideYml
|
163
167
|
},
|
164
|
-
)
|
165
|
-
```
|
166
|
-
|
167
|
-
- Export member `configs` from the new instance of `linted`, which is ESLint's flat config. *e.g.*
|
168
|
-
|
169
|
-
```javascript
|
170
|
-
import linted from "linted";
|
171
|
-
|
172
|
-
export default [
|
173
|
-
...new linted(
|
174
|
-
// ...
|
175
|
-
)
|
176
|
-
.configs,
|
177
|
-
];
|
178
|
-
|
168
|
+
);
|
179
169
|
```
|
180
170
|
|
181
171
|
___
|
@@ -248,10 +238,10 @@ yml
|
|
248
238
|
|
249
239
|
- svelte: .js, .ts, .svelte
|
250
240
|
|
251
|
-
- jest: .js, .ts, (.spec).ts
|
252
|
-
|
253
241
|
- html: .html
|
254
242
|
|
243
|
+
- jest: .js, .ts, (.spec).ts
|
244
|
+
|
255
245
|
- jsonc: .json (JSON), .json (JSONC)
|
256
246
|
|
257
247
|
- json: .json (JSON)
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "linted",
|
3
|
-
"version": "13.0.
|
3
|
+
"version": "13.0.3",
|
4
4
|
"description": "Zero-config ESLint flat config factory for (strict, agglutinative) entire-stack formatting and linting: TypeScript, JavaScript, Svelte, HTML, (Tailwind) CSS, Jest, JSON(C), and sadly YAML.",
|
5
5
|
"keywords": [
|
6
6
|
"eslint",
|
@@ -77,7 +77,7 @@
|
|
77
77
|
},
|
78
78
|
"devDependencies": {
|
79
79
|
"eslint": "~8.57.0",
|
80
|
-
"linted": "~13.0.
|
80
|
+
"linted": "~13.0.2",
|
81
81
|
"typescript": "^5.5.2"
|
82
82
|
},
|
83
83
|
"scripts": {
|