linted 19.3.1 → 19.4.0-rc.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.github/workflows/RELEASE.yml +36 -36
- package/.github/workflows/rc.yml +36 -36
- package/.markdownlint.jsonc +124 -124
- package/LICENSE +21 -21
- package/README.md +387 -387
- package/SECURITY.md +9 -9
- package/dist/imports/index.d.ts.map +1 -1
- package/dist/imports/plugins.d.ts.map +1 -1
- package/dist/rules/index.d.ts +4 -0
- package/dist/rules/index.d.ts.map +1 -1
- package/dist/rules/js/index.d.ts +1 -0
- package/dist/rules/js/index.d.ts.map +1 -1
- package/dist/rules/js/stylistic.d.ts +1 -0
- package/dist/rules/js/stylistic.d.ts.map +1 -1
- package/dist/rules/js/stylistic.js +4 -1
- package/dist/rules/js/stylistic.js.map +1 -1
- package/dist/rules/mocha/index.d.ts +1 -0
- package/dist/rules/mocha/index.d.ts.map +1 -1
- package/dist/rules/mochaJs/index.d.ts +1 -0
- package/dist/rules/mochaJs/index.d.ts.map +1 -1
- package/dist/rules/svelte/index.d.ts +1 -0
- package/dist/rules/svelte/index.d.ts.map +1 -1
- package/dist/rules/ts/index.d.ts +1 -0
- package/dist/rules/ts/index.d.ts.map +1 -1
- package/eslint.config.js +3 -3
- package/package.json +140 -140
- package/src/_strings/id.ts +18 -18
- package/src/_strings/index.ts +6 -6
- package/src/_strings/level.spec.ts +31 -31
- package/src/_strings/level.ts +6 -6
- package/src/_strings/state.ts +58 -58
- package/src/files/html.ts +1 -1
- package/src/files/index.ts +19 -19
- package/src/files/js.ts +4 -4
- package/src/files/json.ts +1 -1
- package/src/files/jsonc.ts +4 -4
- package/src/files/mocha.ts +4 -4
- package/src/files/mochaJs.ts +4 -4
- package/src/files/svelte.ts +1 -1
- package/src/files/ts.ts +1 -1
- package/src/files/yml.ts +1 -1
- package/src/imports/index.ts +7 -7
- package/src/imports/parsers.ts +13 -13
- package/src/imports/plugins.ts +17 -17
- package/src/index.spec.ts +11 -11
- package/src/index.ts +22 -22
- package/src/rules/html/enable.ts +120 -120
- package/src/rules/html/index.ts +3 -3
- package/src/rules/index.ts +19 -19
- package/src/rules/js/enable.ts +524 -524
- package/src/rules/js/index.ts +4 -4
- package/src/rules/js/stylistic.ts +611 -608
- package/src/rules/json/enable.ts +33 -33
- package/src/rules/json/enable_x.ts +95 -95
- package/src/rules/json/index.ts +4 -4
- package/src/rules/jsonc/index.ts +4 -4
- package/src/rules/jsonc/override.ts +16 -16
- package/src/rules/mocha/base.ts +7 -7
- package/src/rules/mocha/disable.ts +8 -8
- package/src/rules/mocha/enable.ts +53 -53
- package/src/rules/mocha/index.ts +7 -7
- package/src/rules/mochaJs/index.ts +7 -7
- package/src/rules/svelte/disable.ts +9 -9
- package/src/rules/svelte/disable_js.ts +11 -11
- package/src/rules/svelte/disable_ts.ts +9 -9
- package/src/rules/svelte/enable.ts +230 -230
- package/src/rules/svelte/enable_x.ts +20 -20
- package/src/rules/svelte/index.ts +15 -15
- package/src/rules/ts/disable.ts +22 -22
- package/src/rules/ts/disable_x.ts +32 -32
- package/src/rules/ts/enable.ts +550 -550
- package/src/rules/ts/enable_x.ts +115 -115
- package/src/rules/ts/index.ts +13 -13
- package/src/rules/yml/enable.ts +64 -64
- package/src/rules/yml/enable_x.ts +68 -68
- package/src/rules/yml/index.ts +4 -4
- package/tsconfig.json +163 -163
- package/typings/mocha.d.ts +3 -3
@@ -1,31 +1,31 @@
|
|
1
|
-
import { expect } from "chai";
|
2
|
-
import * as level from "./level";
|
3
|
-
|
4
|
-
describe("Strings:Level", function () {
|
5
|
-
describe("shape", function () {
|
6
|
-
it("is module", function () {
|
7
|
-
expect(level)
|
8
|
-
.a("module");
|
9
|
-
});
|
10
|
-
});
|
11
|
-
describe("count", function () {
|
12
|
-
it("is 3", function () {
|
13
|
-
expect(Object.keys(level))
|
14
|
-
.lengthOf(3);
|
15
|
-
});
|
16
|
-
});
|
17
|
-
describe("unique count", function () {
|
18
|
-
it("is 3", function () {
|
19
|
-
expect(new Map(Object.entries(level)))
|
20
|
-
.lengthOf(3);
|
21
|
-
});
|
22
|
-
});
|
23
|
-
describe("values", function () {
|
24
|
-
it("are: error, warn, off", function () {
|
25
|
-
expect(new Map(Object.entries(level)))
|
26
|
-
.includes("error")
|
27
|
-
.and.includes("warn")
|
28
|
-
.and.includes("off");
|
29
|
-
});
|
30
|
-
});
|
31
|
-
});
|
1
|
+
import { expect } from "chai";
|
2
|
+
import * as level from "./level";
|
3
|
+
|
4
|
+
describe("Strings:Level", function () {
|
5
|
+
describe("shape", function () {
|
6
|
+
it("is module", function () {
|
7
|
+
expect(level)
|
8
|
+
.a("module");
|
9
|
+
});
|
10
|
+
});
|
11
|
+
describe("count", function () {
|
12
|
+
it("is 3", function () {
|
13
|
+
expect(Object.keys(level))
|
14
|
+
.lengthOf(3);
|
15
|
+
});
|
16
|
+
});
|
17
|
+
describe("unique count", function () {
|
18
|
+
it("is 3", function () {
|
19
|
+
expect(new Map(Object.entries(level)))
|
20
|
+
.lengthOf(3);
|
21
|
+
});
|
22
|
+
});
|
23
|
+
describe("values", function () {
|
24
|
+
it("are: error, warn, off", function () {
|
25
|
+
expect(new Map(Object.entries(level)))
|
26
|
+
.includes("error")
|
27
|
+
.and.includes("warn")
|
28
|
+
.and.includes("off");
|
29
|
+
});
|
30
|
+
});
|
31
|
+
});
|
package/src/_strings/level.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
const
|
2
|
-
ERROR = "error",
|
3
|
-
WARN = "warn",
|
4
|
-
OFF = "off";
|
5
|
-
|
6
|
-
export { ERROR, WARN, OFF };
|
1
|
+
const
|
2
|
+
ERROR = "error",
|
3
|
+
WARN = "warn",
|
4
|
+
OFF = "off";
|
5
|
+
|
6
|
+
export { ERROR, WARN, OFF };
|
package/src/_strings/state.ts
CHANGED
@@ -1,58 +1,58 @@
|
|
1
|
-
const
|
2
|
-
Ignore = "ignore",
|
3
|
-
Never = "never",
|
4
|
-
Always = "always",
|
5
|
-
AlwaysMultiline = "always-multiline",
|
6
|
-
Multiline = "multiline",
|
7
|
-
Consistent = "consistent",
|
8
|
-
Consecutive = "consecutive",
|
9
|
-
AsNeeded = "as-needed",
|
10
|
-
Explicit = "explicit",
|
11
|
-
Allow = "allow",
|
12
|
-
Strict = "strict",
|
13
|
-
Any = "any",
|
14
|
-
All = "all",
|
15
|
-
Star = "*",
|
16
|
-
First = "first",
|
17
|
-
Last = "last",
|
18
|
-
Before = "before",
|
19
|
-
After = "after",
|
20
|
-
Above = "above",
|
21
|
-
Below = "below",
|
22
|
-
Beside = "beside",
|
23
|
-
Inside = "inside",
|
24
|
-
Outside = "outside",
|
25
|
-
Single = "single",
|
26
|
-
Double = "double",
|
27
|
-
Multi = "multi",
|
28
|
-
Both = "both";
|
29
|
-
|
30
|
-
export {
|
31
|
-
Ignore,
|
32
|
-
Never,
|
33
|
-
Always,
|
34
|
-
AlwaysMultiline,
|
35
|
-
Multiline,
|
36
|
-
Consistent,
|
37
|
-
Consecutive,
|
38
|
-
AsNeeded,
|
39
|
-
Explicit,
|
40
|
-
Allow,
|
41
|
-
Strict,
|
42
|
-
Any,
|
43
|
-
All,
|
44
|
-
Star,
|
45
|
-
First,
|
46
|
-
Last,
|
47
|
-
Before,
|
48
|
-
After,
|
49
|
-
Above,
|
50
|
-
Below,
|
51
|
-
Beside,
|
52
|
-
Inside,
|
53
|
-
Outside,
|
54
|
-
Single,
|
55
|
-
Double,
|
56
|
-
Multi,
|
57
|
-
Both,
|
58
|
-
};
|
1
|
+
const
|
2
|
+
Ignore = "ignore",
|
3
|
+
Never = "never",
|
4
|
+
Always = "always",
|
5
|
+
AlwaysMultiline = "always-multiline",
|
6
|
+
Multiline = "multiline",
|
7
|
+
Consistent = "consistent",
|
8
|
+
Consecutive = "consecutive",
|
9
|
+
AsNeeded = "as-needed",
|
10
|
+
Explicit = "explicit",
|
11
|
+
Allow = "allow",
|
12
|
+
Strict = "strict",
|
13
|
+
Any = "any",
|
14
|
+
All = "all",
|
15
|
+
Star = "*",
|
16
|
+
First = "first",
|
17
|
+
Last = "last",
|
18
|
+
Before = "before",
|
19
|
+
After = "after",
|
20
|
+
Above = "above",
|
21
|
+
Below = "below",
|
22
|
+
Beside = "beside",
|
23
|
+
Inside = "inside",
|
24
|
+
Outside = "outside",
|
25
|
+
Single = "single",
|
26
|
+
Double = "double",
|
27
|
+
Multi = "multi",
|
28
|
+
Both = "both";
|
29
|
+
|
30
|
+
export {
|
31
|
+
Ignore,
|
32
|
+
Never,
|
33
|
+
Always,
|
34
|
+
AlwaysMultiline,
|
35
|
+
Multiline,
|
36
|
+
Consistent,
|
37
|
+
Consecutive,
|
38
|
+
AsNeeded,
|
39
|
+
Explicit,
|
40
|
+
Allow,
|
41
|
+
Strict,
|
42
|
+
Any,
|
43
|
+
All,
|
44
|
+
Star,
|
45
|
+
First,
|
46
|
+
Last,
|
47
|
+
Before,
|
48
|
+
After,
|
49
|
+
Above,
|
50
|
+
Below,
|
51
|
+
Beside,
|
52
|
+
Inside,
|
53
|
+
Outside,
|
54
|
+
Single,
|
55
|
+
Double,
|
56
|
+
Multi,
|
57
|
+
Both,
|
58
|
+
};
|
package/src/files/html.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export default ["{src,tests,static}/**/*.html"];
|
1
|
+
export default ["{src,tests,static}/**/*.html"];
|
package/src/files/index.ts
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
import js from "./js";
|
2
|
-
import ts from "./ts";
|
3
|
-
import svelte from "./svelte";
|
4
|
-
import mocha from "./mocha";
|
5
|
-
import html from "./html";
|
6
|
-
import json from "./json";
|
7
|
-
import jsonc from "./jsonc";
|
8
|
-
import yml from "./yml";
|
9
|
-
|
10
|
-
export default {
|
11
|
-
js,
|
12
|
-
ts,
|
13
|
-
svelte,
|
14
|
-
mocha,
|
15
|
-
html,
|
16
|
-
json,
|
17
|
-
jsonc,
|
18
|
-
yml,
|
19
|
-
};
|
1
|
+
import js from "./js";
|
2
|
+
import ts from "./ts";
|
3
|
+
import svelte from "./svelte";
|
4
|
+
import mocha from "./mocha";
|
5
|
+
import html from "./html";
|
6
|
+
import json from "./json";
|
7
|
+
import jsonc from "./jsonc";
|
8
|
+
import yml from "./yml";
|
9
|
+
|
10
|
+
export default {
|
11
|
+
js,
|
12
|
+
ts,
|
13
|
+
svelte,
|
14
|
+
mocha,
|
15
|
+
html,
|
16
|
+
json,
|
17
|
+
jsonc,
|
18
|
+
yml,
|
19
|
+
};
|
package/src/files/js.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
export default [
|
2
|
-
"*.{c,m,}js",
|
3
|
-
"{src,tests,static,typings}/**/*.{c,m,}js",
|
4
|
-
];
|
1
|
+
export default [
|
2
|
+
"*.{c,m,}js",
|
3
|
+
"{src,tests,static,typings}/**/*.{c,m,}js",
|
4
|
+
];
|
package/src/files/json.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export default ["**/*.json"];
|
1
|
+
export default ["**/*.json"];
|
package/src/files/jsonc.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
export default [
|
2
|
-
"**/*.jsonc",
|
3
|
-
"**/tsconfig.json",
|
4
|
-
];
|
1
|
+
export default [
|
2
|
+
"**/*.jsonc",
|
3
|
+
"**/tsconfig.json",
|
4
|
+
];
|
package/src/files/mocha.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
export default [
|
2
|
-
"**/*.{spec,test}.{c,m,}ts",
|
3
|
-
"**/test{s,}/**/*.{c,m,}ts",
|
4
|
-
];
|
1
|
+
export default [
|
2
|
+
"**/*.{spec,test}.{c,m,}ts",
|
3
|
+
"**/test{s,}/**/*.{c,m,}ts",
|
4
|
+
];
|
package/src/files/mochaJs.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
export default [
|
2
|
-
"**/*.{spec,test}.{c,m,}js",
|
3
|
-
"**/test{s,}/**/*.{c,m,}js",
|
4
|
-
];
|
1
|
+
export default [
|
2
|
+
"**/*.{spec,test}.{c,m,}js",
|
3
|
+
"**/test{s,}/**/*.{c,m,}js",
|
4
|
+
];
|
package/src/files/svelte.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export default ["{src,tests,static}/**/*.svelte"];
|
1
|
+
export default ["{src,tests,static}/**/*.svelte"];
|
package/src/files/ts.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export default ["**/*.{c,m,}ts"];
|
1
|
+
export default ["**/*.{c,m,}ts"];
|
package/src/files/yml.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export default ["**/*.y{a,}ml"];
|
1
|
+
export default ["**/*.y{a,}ml"];
|
package/src/imports/index.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
import plugins from "./plugins";
|
2
|
-
import parsers from "./parsers";
|
3
|
-
|
4
|
-
export default {
|
5
|
-
plugins,
|
6
|
-
parsers,
|
7
|
-
} as const;
|
1
|
+
import plugins from "./plugins";
|
2
|
+
import parsers from "./parsers";
|
3
|
+
|
4
|
+
export default {
|
5
|
+
plugins,
|
6
|
+
parsers,
|
7
|
+
} as const;
|
package/src/imports/parsers.ts
CHANGED
@@ -1,13 +1,13 @@
|
|
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
|
-
|
7
|
-
export default {
|
8
|
-
ts,
|
9
|
-
svelte,
|
10
|
-
html,
|
11
|
-
jsonc,
|
12
|
-
yml,
|
13
|
-
} as const;
|
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
|
+
|
7
|
+
export default {
|
8
|
+
ts,
|
9
|
+
svelte,
|
10
|
+
html,
|
11
|
+
jsonc,
|
12
|
+
yml,
|
13
|
+
} as const;
|
package/src/imports/plugins.ts
CHANGED
@@ -1,17 +1,17 @@
|
|
1
|
-
import stylistic from "@stylistic/eslint-plugin";
|
2
|
-
import typescript_eslint from "@typescript-eslint/eslint-plugin";
|
3
|
-
import svelte from "eslint-plugin-svelte";
|
4
|
-
import mocha from "eslint-plugin-mocha";
|
5
|
-
import html_eslint from "@html-eslint/eslint-plugin";
|
6
|
-
import jsonc from "eslint-plugin-jsonc";
|
7
|
-
import yml from "eslint-plugin-yml";
|
8
|
-
|
9
|
-
export default {
|
10
|
-
"@stylistic": stylistic,
|
11
|
-
"@typescript-eslint": typescript_eslint as unknown as { configs: unknown },
|
12
|
-
svelte,
|
13
|
-
mocha,
|
14
|
-
"@html-eslint": html_eslint,
|
15
|
-
jsonc,
|
16
|
-
yml,
|
17
|
-
} as const;
|
1
|
+
import stylistic from "@stylistic/eslint-plugin";
|
2
|
+
import typescript_eslint from "@typescript-eslint/eslint-plugin";
|
3
|
+
import svelte from "eslint-plugin-svelte";
|
4
|
+
import mocha from "eslint-plugin-mocha";
|
5
|
+
import html_eslint from "@html-eslint/eslint-plugin";
|
6
|
+
import jsonc from "eslint-plugin-jsonc";
|
7
|
+
import yml from "eslint-plugin-yml";
|
8
|
+
|
9
|
+
export default {
|
10
|
+
"@stylistic": stylistic,
|
11
|
+
"@typescript-eslint": typescript_eslint as unknown as { configs: unknown },
|
12
|
+
svelte,
|
13
|
+
mocha,
|
14
|
+
"@html-eslint": html_eslint,
|
15
|
+
jsonc,
|
16
|
+
yml,
|
17
|
+
} as const;
|
package/src/index.spec.ts
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
import { expect } from "chai";
|
2
|
-
import core from "./";
|
3
|
-
|
4
|
-
describe("Core", function () {
|
5
|
-
describe("shape", function () {
|
6
|
-
it("is function", function () {
|
7
|
-
expect(core)
|
8
|
-
.a("function");
|
9
|
-
});
|
10
|
-
});
|
11
|
-
});
|
1
|
+
import { expect } from "chai";
|
2
|
+
import core from "./";
|
3
|
+
|
4
|
+
describe("Core", function () {
|
5
|
+
describe("shape", function () {
|
6
|
+
it("is function", function () {
|
7
|
+
expect(core)
|
8
|
+
.a("function");
|
9
|
+
});
|
10
|
+
});
|
11
|
+
});
|
package/src/index.ts
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
import type { Input } from "@eslinted/core";
|
2
|
-
import core from "@eslinted/core";
|
3
|
-
import imports from "./imports";
|
4
|
-
import files from "./files";
|
5
|
-
import rules from "./rules";
|
6
|
-
|
7
|
-
export default function (
|
8
|
-
includes: Input["files"]["includes"] = {},
|
9
|
-
overrides: Input["rules"]["overrides"] = {},
|
10
|
-
) {
|
11
|
-
try {
|
12
|
-
return core(
|
13
|
-
{
|
14
|
-
plugins: imports.plugins,
|
15
|
-
parsers: imports.parsers,
|
16
|
-
files: { files, includes },
|
17
|
-
rules: { rules, overrides },
|
18
|
-
},
|
19
|
-
);
|
20
|
-
}
|
21
|
-
catch (e) { throw new Error(`linted(): `, { cause: e }); }
|
22
|
-
}
|
1
|
+
import type { Input } from "@eslinted/core";
|
2
|
+
import core from "@eslinted/core";
|
3
|
+
import imports from "./imports";
|
4
|
+
import files from "./files";
|
5
|
+
import rules from "./rules";
|
6
|
+
|
7
|
+
export default function (
|
8
|
+
includes: Input["files"]["includes"] = {},
|
9
|
+
overrides: Input["rules"]["overrides"] = {},
|
10
|
+
) {
|
11
|
+
try {
|
12
|
+
return core(
|
13
|
+
{
|
14
|
+
plugins: imports.plugins,
|
15
|
+
parsers: imports.parsers,
|
16
|
+
files: { files, includes },
|
17
|
+
rules: { rules, overrides },
|
18
|
+
},
|
19
|
+
);
|
20
|
+
}
|
21
|
+
catch (e) { throw new Error(`linted(): `, { cause: e }); }
|
22
|
+
}
|