linted 14.1.1 → 14.1.3-rc.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/README.md +223 -134
- package/dist/bundle/config/Config.d.ts +6 -0
- package/dist/bundle/config/Config.d.ts.map +1 -0
- package/dist/bundle/config/Config.js +9 -0
- package/dist/bundle/config/Config.js.map +1 -0
- package/dist/bundle/config/default/files.d.ts +11 -0
- package/dist/bundle/config/default/files.d.ts.map +1 -0
- package/dist/bundle/config/default/files.js +13 -0
- package/dist/bundle/config/default/files.js.map +1 -0
- package/dist/bundle/config/default/option/MdOption.d.ts +5 -0
- package/dist/bundle/config/default/option/MdOption.d.ts.map +1 -0
- package/dist/bundle/config/default/option/MdOption.js +16 -0
- package/dist/bundle/config/default/option/MdOption.js.map +1 -0
- package/dist/bundle/config/default/option/YmlOption.d.ts.map +1 -1
- package/dist/bundle/config/default/option/YmlOption.js.map +1 -1
- package/dist/bundle/config/default/{Options.js → options.d.ts} +11 -3
- package/dist/bundle/config/default/options.d.ts.map +1 -0
- package/dist/bundle/config/default/{Options.d.ts → options.js} +10 -3
- package/dist/bundle/config/default/options.js.map +1 -0
- package/dist/bundle/config/default/parsers.d.ts +15 -0
- package/dist/bundle/config/default/parsers.d.ts.map +1 -0
- package/dist/bundle/config/default/parsers.js +14 -0
- package/dist/bundle/config/default/parsers.js.map +1 -0
- package/dist/bundle/config/default/plugins.d.ts +1044 -0
- package/dist/bundle/config/default/plugins.d.ts.map +1 -0
- package/dist/bundle/config/default/plugins.js +24 -0
- package/dist/bundle/config/default/plugins.js.map +1 -0
- package/dist/bundle/config/default/ruleset/MdRuleset.d.ts +4 -0
- package/dist/bundle/config/default/ruleset/MdRuleset.d.ts.map +1 -0
- package/dist/bundle/config/default/ruleset/MdRuleset.js +5 -0
- package/dist/bundle/config/default/ruleset/MdRuleset.js.map +1 -0
- package/dist/bundle/config/default/ruleset/rules/js/JsEnable.d.ts.map +1 -1
- package/dist/bundle/config/default/ruleset/rules/js/JsEnable.js.map +1 -1
- package/dist/bundle/config/default/ruleset/rules/md/MdEnable.d.ts +4 -0
- package/dist/bundle/config/default/ruleset/rules/md/MdEnable.d.ts.map +1 -0
- package/dist/bundle/config/default/ruleset/rules/md/MdEnable.js +60 -0
- package/dist/bundle/config/default/ruleset/rules/md/MdEnable.js.map +1 -0
- package/dist/bundle/config/default/ruleset/rules/ts/TsEnable.js +1 -1
- package/dist/bundle/config/default/ruleset/rules/ts/TsEnable.js.map +1 -1
- package/dist/bundle/config/default/rulesets.d.ts +12 -0
- package/dist/bundle/config/default/rulesets.d.ts.map +1 -0
- package/dist/bundle/config/default/{Rulesets.d.ts → rulesets.js} +10 -3
- package/dist/bundle/config/default/rulesets.js.map +1 -0
- package/dist/bundle/config/default/scopes.d.ts +4 -0
- package/dist/bundle/config/default/scopes.d.ts.map +1 -0
- package/dist/bundle/config/default/scopes.js +11 -0
- package/dist/bundle/config/default/scopes.js.map +1 -0
- package/dist/bundle/index.d.ts +3 -18
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/index.js +46 -139
- package/dist/bundle/index.js.map +1 -1
- package/package.json +25 -27
- package/dist/bundle/config/default/Options.d.ts.map +0 -1
- package/dist/bundle/config/default/Options.js.map +0 -1
- package/dist/bundle/config/default/Rulesets.d.ts.map +0 -1
- package/dist/bundle/config/default/Rulesets.js +0 -10
- package/dist/bundle/config/default/Rulesets.js.map +0 -1
- package/dist/bundle/config/default/option/HtmlOption.spec.d.ts +0 -2
- package/dist/bundle/config/default/option/HtmlOption.spec.d.ts.map +0 -1
- package/dist/bundle/config/default/option/HtmlOption.spec.js +0 -10
- package/dist/bundle/config/default/option/HtmlOption.spec.js.map +0 -1
- package/dist/bundle/config/default/option/JestOption.d.ts +0 -6
- package/dist/bundle/config/default/option/JestOption.d.ts.map +0 -1
- package/dist/bundle/config/default/option/JestOption.js +0 -26
- package/dist/bundle/config/default/option/JestOption.js.map +0 -1
- package/dist/bundle/config/default/ruleset/JestRuleset.d.ts +0 -4
- package/dist/bundle/config/default/ruleset/JestRuleset.d.ts.map +0 -1
- package/dist/bundle/config/default/ruleset/JestRuleset.js +0 -7
- package/dist/bundle/config/default/ruleset/JestRuleset.js.map +0 -1
- package/dist/bundle/config/default/ruleset/rules/jest/JestEnable.d.ts +0 -1
- package/dist/bundle/config/default/ruleset/rules/jest/JestEnable.d.ts.map +0 -1
- package/dist/bundle/config/default/ruleset/rules/jest/JestEnable.js +0 -2
- package/dist/bundle/config/default/ruleset/rules/jest/JestEnable.js.map +0 -1
- package/dist/bundle/config/default/ruleset/rules/jest/JestRecommended.d.ts +0 -4
- package/dist/bundle/config/default/ruleset/rules/jest/JestRecommended.d.ts.map +0 -1
- package/dist/bundle/config/default/ruleset/rules/jest/JestRecommended.js +0 -7
- package/dist/bundle/config/default/ruleset/rules/jest/JestRecommended.js.map +0 -1
package/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# [`linted`](https://npmjs.com/package/linted)
|
1
|
+
# [`linted`](https://npmjs.com/package/linted)
|
2
2
|
|
3
|
-
Zero-config [__ESLint__](https://eslint.org/) flat config factory for (strict, agglutinative) entire-stack formatting and linting: TypeScript, JavaScript, Svelte, HTML, (Tailwind) CSS,
|
3
|
+
Zero-config [__ESLint__](https://eslint.org/) flat config factory for (strict, agglutinative) entire-stack formatting and linting: TypeScript, JavaScript, Svelte, HTML, (Tailwind) CSS, Mocha, JSON(C), and sadly YAML.
|
4
4
|
|
5
5
|
1. [Languages](#languages)
|
6
6
|
1. [Features](#features)
|
@@ -9,77 +9,31 @@ Zero-config [__ESLint__](https://eslint.org/) flat config factory for (strict, a
|
|
9
9
|
1. [Roadmap](#roadmap)
|
10
10
|
1. [Rule Logic (Advanced)](#rule-logic-advanced)
|
11
11
|
|
12
|
+
v14.1 is in progress, in the meantime this readme is totally inaccurate.
|
13
|
+
|
12
14
|
## Languages
|
13
15
|
|
14
16
|
### Web
|
15
17
|
|
16
18
|
- __[JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript):__ [`eslint`](https://eslint.org) + [`@stylistic`](https://eslint.style)
|
17
|
-
- __[TypeScript](https://typescriptlang.org):__ + [`@typescript-eslint`](https://typescript-eslint.io/)
|
18
|
-
- __[Svelte](https://svelte.dev):__ + [`eslint-plugin-svelte`](https://sveltejs.github.io/eslint-plugin-svelte/)
|
19
|
+
- __[TypeScript](https://typescriptlang.org):__ _...JavaScript_ + [`@typescript-eslint`](https://typescript-eslint.io/)
|
20
|
+
- __[Svelte](https://svelte.dev):__ _...TypeScript_ + [`eslint-plugin-svelte`](https://sveltejs.github.io/eslint-plugin-svelte/)
|
19
21
|
- __[HTML](https://developer.mozilla.org/en-US/docs/Web/HTML):__ [`@html-eslint`](https://html-eslint.org/)
|
20
22
|
|
21
23
|
### Data
|
22
24
|
|
23
|
-
- __[JSON](https://json.org)
|
25
|
+
- __[JSON](https://json.org) & [JSONC](https://code.visualstudio.com/docs/languages/json#_json-with-comments):__ [`eslint-plugin-jsonc`](https://ota-meshi.github.io/eslint-plugin-jsonc/)
|
24
26
|
- __[YAML](https://redhat.com/en/topics/automation/what-is-yaml):__ [`eslint-plugin-yml`](https://ota-meshi.github.io/eslint-plugin-yml/)
|
25
27
|
|
26
|
-
###
|
28
|
+
### Text
|
27
29
|
|
28
|
-
- __[
|
30
|
+
- __[GitHub Flavored Markdown](https://github.github.com/gfm/) & [CommonMark](https://commonmark.org):__ [`eslint-plugin-markdownlint`](https://gitlab.com/pawelbbdrozd/eslint-plugin-markdownlint/-/blob/main/README.md)
|
29
31
|
|
30
32
|
\
|
31
33
|
_See language support __[roadmap](#roadmap).___
|
32
34
|
|
33
35
|
## Features
|
34
36
|
|
35
|
-
### One-Arugment API
|
36
|
-
|
37
|
-
#### _or..._
|
38
|
-
|
39
|
-
- Scope (i.e. files to lint)
|
40
|
-
- _Optional:_ [override](#full-control-via-per-scope-override) rules
|
41
|
-
|
42
|
-
### Two-Statement `eslint.config.js`
|
43
|
-
|
44
|
-
```javascript
|
45
|
-
import linted from "linted";
|
46
|
-
|
47
|
-
export default linted(
|
48
|
-
{ // Scope (i.e. files to lint)
|
49
|
-
js: [
|
50
|
-
"eslint.config.js",
|
51
|
-
"svelte.config.js",
|
52
|
-
],
|
53
|
-
ts: [
|
54
|
-
"src/**/*.ts",
|
55
|
-
"vite.config.ts",
|
56
|
-
],
|
57
|
-
svelte: ["src/**/*.svelte"],
|
58
|
-
// ...
|
59
|
-
},
|
60
|
-
);
|
61
|
-
```
|
62
|
-
|
63
|
-
### Full Control via _Per-Scope_ Override
|
64
|
-
|
65
|
-
```javascript
|
66
|
-
// ...Scope (i.e. files to lint)
|
67
|
-
},
|
68
|
-
{ // Optional: Override
|
69
|
-
overrideTs: {
|
70
|
-
// Turns it off in "ts" scope,
|
71
|
-
// but NOT in "js" scope,
|
72
|
-
// NOR in "svelte" scope.
|
73
|
-
"no-unused-vars": "off", // JS base rule
|
74
|
-
// "@typescript-eslint/ ..., or TS plugin rule
|
75
|
-
},
|
76
|
-
overrideSvelte: {
|
77
|
-
// ... JS, TS, or Svelte plugin rules
|
78
|
-
},
|
79
|
-
},
|
80
|
-
);
|
81
|
-
```
|
82
|
-
|
83
37
|
### Zero-Dependency
|
84
38
|
|
85
39
|
No need to install 17 plugins and 12 parsers: each language's latest plugin is bundled and configured.
|
@@ -88,7 +42,7 @@ No need to install 17 plugins and 12 parsers: each language's latest plugin is b
|
|
88
42
|
|
89
43
|
No need to remember each plugin's `parserOptions`; you won't have to do _this_ just to enable Svelte linting:
|
90
44
|
|
91
|
-
|
45
|
+
```javascript
|
92
46
|
// lint TypeScript blocks in Svelte
|
93
47
|
plugins: {
|
94
48
|
"@stylistic": stylistic,
|
@@ -107,71 +61,141 @@ No need to remember each plugin's `parserOptions`; you won't have to do _this_ j
|
|
107
61
|
extraFileExtensions: [".svelte"],
|
108
62
|
},
|
109
63
|
},
|
110
|
-
processor: "svelte/svelte"
|
111
|
-
|
64
|
+
processor: "svelte/svelte",
|
65
|
+
```
|
66
|
+
|
67
|
+
### Zero-Arugment API
|
68
|
+
|
69
|
+
```javascript
|
70
|
+
linted();
|
71
|
+
```
|
72
|
+
|
73
|
+
### Two-Statement `eslint.config.js`
|
74
|
+
|
75
|
+
```javascript
|
76
|
+
import linted from "linted";
|
77
|
+
|
78
|
+
export default linted();
|
79
|
+
```
|
80
|
+
|
81
|
+
### (WIP for v14.1, currently inaccurate) Total Control via Optional Arguments
|
82
|
+
|
83
|
+
- `includes` (scoped [`glob patterns`](code.visualstudio.com/docs/editor/glob-patterns))
|
84
|
+
- `ignores` (global [`glob patterns`](code.visualstudio.com/docs/editor/glob-patterns) and other options)
|
85
|
+
- `overrides` (scoped rule statements)
|
86
|
+
|
87
|
+
#### `includes` _(Scoped)_
|
88
|
+
|
89
|
+
```javascript
|
90
|
+
import linted from "linted";
|
91
|
+
|
92
|
+
linted(
|
93
|
+
{
|
94
|
+
/** includes **/
|
95
|
+
js: [
|
96
|
+
"scripts/**/*/.{js,mjs}",
|
97
|
+
"*.config.js",
|
98
|
+
], /* example: array of glob patterns to lint using JavaScript rules */
|
99
|
+
ts: [
|
100
|
+
"src/**/*.ts",
|
101
|
+
"*.config.ts",
|
102
|
+
],
|
103
|
+
|
104
|
+
// svelte: [],
|
105
|
+
// html: [],
|
106
|
+
|
107
|
+
/* ...json, jsonc, yml, */
|
108
|
+
},
|
109
|
+
)
|
110
|
+
```
|
111
|
+
|
112
|
+
#### `ignores` _(Global)_
|
113
|
+
|
114
|
+
```javascript
|
115
|
+
import linted from "linted";
|
116
|
+
|
117
|
+
linted(
|
118
|
+
{ /** includes **/ },
|
119
|
+
{
|
120
|
+
/** ignores **/
|
121
|
+
gitignore: true, /* (default) never lint any git-ignored file */
|
122
|
+
ignoreArtifacts: true, /* (default) never lint "**/*/package-lock.json" */
|
123
|
+
global: [], /* array of glob patterns to never lint */
|
124
|
+
},
|
125
|
+
)
|
126
|
+
```
|
127
|
+
|
128
|
+
#### `overrides` _(Scoped)_
|
129
|
+
|
130
|
+
```javascript
|
131
|
+
linted(
|
132
|
+
{ /** includes **/ },
|
133
|
+
{ /** ignores **/ },
|
134
|
+
{
|
135
|
+
/** overrides **/
|
136
|
+
overrideJs: {}, /* js rule overrides */
|
137
|
+
overrideTs: {
|
138
|
+
/* Overrides apply to `ts` scope,
|
139
|
+
* but NOT to `js` scope,
|
140
|
+
* NOR to `svelte` scope.
|
141
|
+
*/
|
142
|
+
"no-unused-vars": "off", /* example: ESLint base rule */
|
143
|
+
"@typescript-eslint/indent": "warn", /* example: TypeScript plugin rule */
|
144
|
+
}, /* js rule overrides */
|
145
|
+
|
146
|
+
/* ...overrideTs, overrideSvelte, overrideHtml, overrideJson, overrideJsonc, overrideYml, */
|
147
|
+
},
|
148
|
+
)
|
149
|
+
```
|
112
150
|
|
113
151
|
## Limitation
|
114
152
|
|
115
|
-
|
153
|
+
In __TypeScript__ projects, [`skipLibCheck`](https://www.typescriptlang.org/tsconfig/#skipLibCheck) must be `true`.
|
154
|
+
|
155
|
+
### Enable `skipLibCheck`
|
116
156
|
|
117
|
-
|
118
|
-
- TypeScript's official `.tsconfig` `strict` template has `skipLibCheck: true`, so `linted` views accepts skipping library check as acceptable for overall type safety.
|
157
|
+
By default, `skipLibCheck` is `false`. To set it to `true`:
|
119
158
|
|
120
|
-
|
159
|
+
#### `tsconfig.json`
|
121
160
|
|
122
161
|
```jsonc
|
123
162
|
{
|
124
163
|
"compilerOptions": {
|
125
|
-
"skipLibCheck":
|
164
|
+
"skipLibCheck": true,
|
126
165
|
},
|
127
166
|
}
|
128
167
|
```
|
129
168
|
|
130
|
-
|
169
|
+
#### _...or_ `tsc` CLI option
|
131
170
|
|
132
|
-
|
171
|
+
```bash
|
172
|
+
tsc --skipLibCheck
|
173
|
+
```
|
133
174
|
|
134
175
|
## Install
|
135
176
|
|
136
|
-
1. Install [`eslint`](https://npmjs.com/package/eslint) and [`linted`](https://npmjs.com/package/linted)
|
177
|
+
1. Install [`eslint`](https://npmjs.com/package/eslint) and [`linted`](https://npmjs.com/package/linted).
|
137
178
|
|
138
179
|
```bash
|
139
|
-
npm i -D eslint@^8.57 linted
|
180
|
+
npm i -D eslint@^8.57 linted
|
140
181
|
```
|
141
182
|
|
142
|
-
1. Create `eslint.config.js` in your root
|
183
|
+
1. Create `eslint.config.js` in your project root.
|
143
184
|
|
144
185
|
1. In `eslint.config.js`:
|
145
|
-
- Import
|
186
|
+
- Import function `linted`.
|
146
187
|
|
147
188
|
```javascript
|
148
189
|
import linted from "linted";
|
149
190
|
```
|
150
191
|
|
151
|
-
- Export `linted` with arguments:
|
192
|
+
- Export `linted` with optional [arguments](#one-argument-api):
|
152
193
|
|
153
194
|
```javascript
|
154
195
|
import linted from "linted";
|
155
196
|
|
156
197
|
export default linted(
|
157
|
-
|
158
|
-
js: ["*.config.js"], // glob pattern array
|
159
|
-
ts: ["*.config.ts", "src/**/*.ts"],
|
160
|
-
svelte: [
|
161
|
-
// ...
|
162
|
-
],
|
163
|
-
|
164
|
-
// ...html, jest, json, jsonc, yml
|
165
|
-
},
|
166
|
-
{ // Optional: Override
|
167
|
-
overrideJs: {
|
168
|
-
// ...same rule schema as ESLint
|
169
|
-
},
|
170
|
-
|
171
|
-
// ...overrideTs, overrideSvelte, overrideHtml,
|
172
|
-
// overrideJest, overrideJson, overrideJsonC,
|
173
|
-
// overrideYml
|
174
|
-
},
|
198
|
+
// ...
|
175
199
|
);
|
176
200
|
```
|
177
201
|
|
@@ -181,6 +205,10 @@ ___
|
|
181
205
|
|
182
206
|
### v11
|
183
207
|
|
208
|
+
#### Mocha
|
209
|
+
|
210
|
+
- Mocha
|
211
|
+
|
184
212
|
#### Tailwind PostCSS
|
185
213
|
|
186
214
|
- [Tailwind](https://github.com/francoismassart/eslint-plugin-tailwindcss)
|
@@ -194,6 +222,7 @@ ___
|
|
194
222
|
- Embedded CSS
|
195
223
|
|
196
224
|
- Svelte Interaction TBD
|
225
|
+
|
197
226
|
- .svelte-embedded HTML (on top of Svelte HTML rules)
|
198
227
|
|
199
228
|
- .html files in Svelte projects (e.g. title not required)
|
@@ -208,72 +237,132 @@ ___
|
|
208
237
|
|
209
238
|
## Rule Logic (Advanced)
|
210
239
|
|
211
|
-
###
|
240
|
+
### What is `scope`?
|
212
241
|
|
213
|
-
|
242
|
+
Each `scope` maps to a unique `language`:
|
214
243
|
|
215
|
-
-
|
244
|
+
- __`js`:__ `JavaScript`
|
216
245
|
|
217
|
-
-
|
246
|
+
- __`ts`:__ `TypeScript`
|
218
247
|
|
219
|
-
|
248
|
+
- __`svelte`:__ `Svelte`
|
220
249
|
|
221
|
-
|
222
|
-
js
|
223
|
-
ts
|
224
|
-
svelte
|
225
|
-
html
|
226
|
-
jest
|
227
|
-
json
|
228
|
-
jsonc
|
229
|
-
yml
|
230
|
-
```
|
250
|
+
- __`html`:__ `HTML`
|
231
251
|
|
232
|
-
|
252
|
+
- __`json`:__ `JSON`
|
233
253
|
|
234
|
-
|
254
|
+
- __`jsonc`:__ `JSONC`
|
235
255
|
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
jest: ["src/**/*.spec.ts"],
|
246
|
-
json: ["package.json"],
|
247
|
-
jsonc: ["tsconfig.json"],
|
248
|
-
yml: [".github/workflows/*.yml"],
|
249
|
-
},
|
250
|
-
```
|
256
|
+
- __`yml`:__ `YAML`
|
257
|
+
|
258
|
+
### Rules
|
259
|
+
|
260
|
+
Each `scope` supports:
|
261
|
+
|
262
|
+
- all base ESLint rules
|
263
|
+
|
264
|
+
- all rules from its `language`'s [__plugins__](#languages)
|
251
265
|
|
252
266
|
#### Default Rules
|
253
267
|
|
254
|
-
- Each
|
268
|
+
- Each `language` has a set of default rules.
|
269
|
+
|
270
|
+
#### Language-Aggregate `scope`
|
271
|
+
|
272
|
+
A `language` can be an extension of or depend on another `language`.
|
273
|
+
|
274
|
+
For example:
|
275
|
+
|
276
|
+
- TypeScript extends JavaScript
|
277
|
+
|
278
|
+
- Svelte depends on TypeScript (which extends JavaScript)
|
279
|
+
|
280
|
+
For such a `language`, its `scope`'s default rules are aggregated with the default rules of extended or consumed `language`s by `scope` precedence:
|
255
281
|
|
256
|
-
-
|
282
|
+
- __`js`:__ `js`
|
257
283
|
|
258
|
-
-
|
284
|
+
- __`ts`:__ `js` < `ts`
|
259
285
|
|
260
|
-
|
286
|
+
- __`svelte`:__ `js` < `ts` < `svelte`
|
261
287
|
|
262
|
-
-
|
288
|
+
- __`html`:__ `html`
|
263
289
|
|
264
|
-
-
|
290
|
+
- __`json`:__ `json`
|
265
291
|
|
266
|
-
-
|
292
|
+
- __`jsonc`:__ `json` < `jsonc`
|
267
293
|
|
268
|
-
-
|
294
|
+
- __`yml`:__ `yml`
|
269
295
|
|
270
|
-
|
296
|
+
### Files
|
271
297
|
|
272
|
-
|
298
|
+
#### Global Ignores
|
273
299
|
|
274
|
-
|
300
|
+
##### `.gitignore`
|
275
301
|
|
276
|
-
|
302
|
+
By default, `linted` ignores all files in `.gitignore`. This behavior can be disabled.
|
303
|
+
|
304
|
+
##### `package-lock.json`
|
305
|
+
|
306
|
+
`**/*.package-lock.json` is always skipped. _This cannot be overriden._
|
307
|
+
|
308
|
+
##### `ignores`
|
309
|
+
|
310
|
+
Additional glob patterns supplied if matched by a file will skip linting that file, even if a scope pattern matches the file.
|
311
|
+
|
312
|
+
#### Scoped Includes
|
313
|
+
|
314
|
+
Files specified in `scope` are appended to the following default files:
|
315
|
+
|
316
|
+
```javascript
|
317
|
+
{
|
318
|
+
js: [
|
319
|
+
"{src,static}/**/*.{js,mjs,cjs}",
|
320
|
+
"*.{js,mjs,cjs}",
|
321
|
+
],
|
322
|
+
ts: [
|
323
|
+
"{src,static}/**/*.{ts,mts,cts}",
|
324
|
+
"*.{ts,mts,cts}",
|
325
|
+
],
|
326
|
+
svelte: ["{src,static}/**/*.svelte"],
|
327
|
+
html: [
|
328
|
+
"{src,static}/**/*.html",
|
329
|
+
"*.html",
|
330
|
+
],
|
331
|
+
json: [
|
332
|
+
"{src,static}/**/*.json",
|
333
|
+
"*.json",
|
334
|
+
],
|
335
|
+
jsonc: [
|
336
|
+
"tsconfig.json",
|
337
|
+
"{src,static}/**/*.jsonc",
|
338
|
+
"*.jsonc",
|
339
|
+
],
|
340
|
+
yml: [
|
341
|
+
".github/workflows/*.{yml,yaml}",
|
342
|
+
"{src,static}/**/*.{yml,yaml}",
|
343
|
+
"*.{yml,yaml}",
|
344
|
+
],
|
345
|
+
},
|
346
|
+
```
|
347
|
+
|
348
|
+
#### Scope Conflict
|
349
|
+
|
350
|
+
- If a given file matches more than one `scope` glob, then the set of all matching `scope`s' rules are applied to the file.
|
351
|
+
|
352
|
+
- If any rule is specified in more than one `scope` matching a given file, the specifies a rule, then the highest-precedence `scope`'s rule specification wins.
|
353
|
+
|
354
|
+
##### Scope Precedence (low to high)
|
355
|
+
|
356
|
+
```bash
|
357
|
+
js
|
358
|
+
ts
|
359
|
+
svelte
|
360
|
+
html
|
361
|
+
json
|
362
|
+
jsonc
|
363
|
+
yml
|
364
|
+
ignores (global)
|
365
|
+
```
|
277
366
|
|
278
367
|
### Override
|
279
368
|
|
@@ -281,12 +370,12 @@ Overrides are per-__scope.__
|
|
281
370
|
|
282
371
|
#### Example
|
283
372
|
|
284
|
-
`overrideTs` rules apply to files
|
373
|
+
`overrideTs` rules apply to files which:
|
285
374
|
|
286
375
|
- ✅ ONLY match scope `ts`.
|
287
376
|
|
288
377
|
- ✅ match scope `ts` and any number of lower precedence scopes (e.g. `js`).
|
289
378
|
|
290
|
-
`overrideTs` rules do __NOT__ apply to files
|
379
|
+
`overrideTs` rules do __NOT__ apply to files which:
|
291
380
|
|
292
381
|
- ❌ match scope `ts` and at least one higher precedence scope (e.g. `svelte`), even if the higher precedence scope includes `ts` language default rules (e.g. `svelte` includes `ts` default rules, but NOT `overrideTs` rules).
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../../src/bundle/config/Config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,MAAM;aAIP,IAAI,EAAE,OAAO;IAH/B,SAAgB,MAAM,EAAE,OAAO,CAAC;gBAGd,IAAI,EAAE,OAAO;CAIhC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Config.js","sourceRoot":"","sources":["../../../src/bundle/config/Config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,OAAO,MAAM;IAIP;IAHF,MAAM,CAAU;IAEhC,YACkB,IAAa;QAAb,SAAI,GAAJ,IAAI,CAAS;QAE7B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;CACF"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../../src/bundle/config/default/files.ts"],"names":[],"mappings":";;;;;;;;;AAEA,wBAeE"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
export default {
|
2
|
+
js: ["*.config.js"],
|
3
|
+
ts: [
|
4
|
+
"src/**/*.ts",
|
5
|
+
"*.config.ts",
|
6
|
+
],
|
7
|
+
svelte: ["src/**/*.svelte"],
|
8
|
+
html: ["src/**/*.html"],
|
9
|
+
json: ["**/*.json"],
|
10
|
+
jsonc: ["tsconfig.json"],
|
11
|
+
yml: [".github/workflows/*.yml"],
|
12
|
+
};
|
13
|
+
//# sourceMappingURL=files.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../../src/bundle/config/default/files.ts"],"names":[],"mappings":"AAEA,eAAe;IACb,EAAE,EAAE,CAAC,aAAa,CAAC;IACnB,EAAE,EAAE;QACF,aAAa;QACb,aAAa;KACd;IACD,MAAM,EAAE,CAAC,iBAAiB,CAAC;IAC3B,IAAI,EAAE,CAAC,eAAe,CAAC;IACvB,IAAI,EAAE,CAAC,WAAW,CAAC;IACnB,KAAK,EAAE,CAAC,eAAe,CAAC;IACxB,GAAG,EAAE,CAAC,yBAAyB,CAAC;CAKjC,CAAC"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import Option from "./base/Option.js";
|
2
|
+
export default class MdOption extends Option<"md", "yml", true, {}, never, never, "", ""> {
|
3
|
+
constructor(plugins: MdOption["body"]["plugins"], parser: MdOption["body"]["languageOptions"]["parser"], ...files: string[]);
|
4
|
+
}
|
5
|
+
//# sourceMappingURL=MdOption.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MdOption.d.ts","sourceRoot":"","sources":["../../../../../src/bundle/config/default/option/MdOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAAM,CAC1C,IAAI,EAEJ,KAAK,EAEL,IAAI,EAEJ,EAAE,EAEF,KAAK,EAEL,KAAK,EAEL,EAAE,EAEF,EAAE,CACH;gBAEG,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EACpC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,EACrD,GAAG,KAAK,EAAE,MAAM,EAAE;CAerB"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import Option from "./base/Option.js";
|
2
|
+
export default class MdOption extends Option {
|
3
|
+
constructor(plugins, parser, ...files) {
|
4
|
+
super({
|
5
|
+
name: "linted/scope:md",
|
6
|
+
files,
|
7
|
+
plugins,
|
8
|
+
linterOptions: {
|
9
|
+
noInlineConfig: true,
|
10
|
+
reportUnusedDisableDirectives: "error",
|
11
|
+
},
|
12
|
+
languageOptions: { parser },
|
13
|
+
});
|
14
|
+
}
|
15
|
+
}
|
16
|
+
//# sourceMappingURL=MdOption.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MdOption.js","sourceRoot":"","sources":["../../../../../src/bundle/config/default/option/MdOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,MAgBrC;IACC,YACE,OAAoC,EACpC,MAAqD,EACrD,GAAG,KAAe;QAElB,KAAK,CACH;YACE,IAAI,EAAE,iBAAiB;YACvB,KAAK;YACL,OAAO;YACP,aAAa,EAAE;gBACb,cAAc,EAAE,IAAI;gBACpB,6BAA6B,EAAE,OAAO;aACvC;YACD,eAAe,EAAE,EAAE,MAAM,EAAE;SAC5B,CACF,CAAC;IACJ,CAAC;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"YmlOption.d.ts","sourceRoot":"","sources":["../../../../../src/bundle/config/default/option/YmlOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,MAAM,CAC3C,KAAK,EAEL,KAAK,EAEL,IAAI,EAEJ,EAAE,EAEF,KAAK,EAEL,KAAK,EAEL,EAAE,EAEF,EAAE,CACH;gBAEG,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EACrC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,EACtD,GAAG,KAAK,EAAE,MAAM,EAAE;
|
1
|
+
{"version":3,"file":"YmlOption.d.ts","sourceRoot":"","sources":["../../../../../src/bundle/config/default/option/YmlOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,MAAM,CAC3C,KAAK,EAEL,KAAK,EAEL,IAAI,EAEJ,EAAE,EAEF,KAAK,EAEL,KAAK,EAEL,EAAE,EAEF,EAAE,CACH;gBAEG,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EACrC,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,EACtD,GAAG,KAAK,EAAE,MAAM,EAAE;CAerB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"YmlOption.js","sourceRoot":"","sources":["../../../../../src/bundle/config/default/option/YmlOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,MAgBtC;IACC,YACE,OAAqC,EACrC,MAAsD,EACtD,GAAG,KAAe;QAElB,KAAK,CACH;YACE,IAAI,EAAE,kBAAkB;YACxB,KAAK;YACL,OAAO;YACP,aAAa,EAAE;gBACb,cAAc,EAAE,IAAI;gBACpB,6BAA6B,EAAE,OAAO;aACvC;YACD,eAAe,EAAE,EAAE,MAAM,EAAE;
|
1
|
+
{"version":3,"file":"YmlOption.js","sourceRoot":"","sources":["../../../../../src/bundle/config/default/option/YmlOption.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,MAgBtC;IACC,YACE,OAAqC,EACrC,MAAsD,EACtD,GAAG,KAAe;QAElB,KAAK,CACH;YACE,IAAI,EAAE,kBAAkB;YACxB,KAAK;YACL,OAAO;YACP,aAAa,EAAE;gBACb,cAAc,EAAE,IAAI;gBACpB,6BAA6B,EAAE,OAAO;aACvC;YACD,eAAe,EAAE,EAAE,MAAM,EAAE;SAC5B,CACF,CAAC;IACJ,CAAC;CACF"}
|
@@ -2,9 +2,17 @@ import JsOption from "./option/JsOption.js";
|
|
2
2
|
import TsOption from "./option/TsOption.js";
|
3
3
|
import SvelteOption from "./option/SvelteOption.js";
|
4
4
|
import HtmlOption from "./option/HtmlOption.js";
|
5
|
-
import JestOption from "./option/JestOption.js";
|
6
5
|
import JsonOption from "./option/JsonOption.js";
|
7
6
|
import JsoncOption from "./option/JsoncOption.js";
|
8
7
|
import YmlOption from "./option/YmlOption.js";
|
9
|
-
|
10
|
-
|
8
|
+
declare const _default: {
|
9
|
+
js: typeof JsOption;
|
10
|
+
ts: typeof TsOption;
|
11
|
+
svelte: typeof SvelteOption;
|
12
|
+
html: typeof HtmlOption;
|
13
|
+
json: typeof JsonOption;
|
14
|
+
jsonc: typeof JsoncOption;
|
15
|
+
yml: typeof YmlOption;
|
16
|
+
};
|
17
|
+
export default _default;
|
18
|
+
//# sourceMappingURL=options.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../src/bundle/config/default/options.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAClD,OAAO,SAAS,MAAM,uBAAuB,CAAC;;;;;;;;;;AAE9C,wBAYE"}
|
@@ -2,9 +2,16 @@ import JsOption from "./option/JsOption.js";
|
|
2
2
|
import TsOption from "./option/TsOption.js";
|
3
3
|
import SvelteOption from "./option/SvelteOption.js";
|
4
4
|
import HtmlOption from "./option/HtmlOption.js";
|
5
|
-
import JestOption from "./option/JestOption.js";
|
6
5
|
import JsonOption from "./option/JsonOption.js";
|
7
6
|
import JsoncOption from "./option/JsoncOption.js";
|
8
7
|
import YmlOption from "./option/YmlOption.js";
|
9
|
-
export {
|
10
|
-
|
8
|
+
export default {
|
9
|
+
js: JsOption,
|
10
|
+
ts: TsOption,
|
11
|
+
svelte: SvelteOption,
|
12
|
+
html: HtmlOption,
|
13
|
+
json: JsonOption,
|
14
|
+
jsonc: JsoncOption,
|
15
|
+
yml: YmlOption,
|
16
|
+
};
|
17
|
+
//# sourceMappingURL=options.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../../src/bundle/config/default/options.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,QAAQ,MAAM,sBAAsB,CAAC;AAC5C,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAChD,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAClD,OAAO,SAAS,MAAM,uBAAuB,CAAC;AAE9C,eAAe;IACb,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,QAAQ;IACZ,MAAM,EAAE,YAAY;IACpB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,WAAW;IAClB,GAAG,EAAE,SAAS;CAKf,CAAC"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import ts from "@typescript-eslint/parser";
|
2
|
+
import svelte from "svelte-eslint-parser";
|
3
|
+
import html from "@html-eslint/parser";
|
4
|
+
import jsonc from "jsonc-eslint-parser";
|
5
|
+
import yml from "yaml-eslint-parser";
|
6
|
+
declare const _default: {
|
7
|
+
ts: typeof ts;
|
8
|
+
svelte: typeof svelte;
|
9
|
+
html: typeof html;
|
10
|
+
json: typeof jsonc;
|
11
|
+
jsonc: typeof jsonc;
|
12
|
+
yml: typeof yml;
|
13
|
+
};
|
14
|
+
export default _default;
|
15
|
+
//# sourceMappingURL=parsers.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"parsers.d.ts","sourceRoot":"","sources":["../../../../src/bundle/config/default/parsers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAC3C,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,IAAI,MAAM,qBAAqB,CAAC;AACvC,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,GAAG,MAAM,oBAAoB,CAAC;;;;;;;;;AAErC,wBAaE"}
|