@eslinted/core 12.0.0-rc.5 → 12.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,26 @@
1
+ import type { Input } from "./index.js";
2
+ export declare class Global {
3
+ readonly plugins: Input["plugins"];
4
+ readonly settings: Input["settings"];
5
+ readonly globals: Input["globals"];
6
+ constructor(plugins: Input["plugins"], settings: Input["settings"], globals: Input["globals"]);
7
+ get configs(): readonly [
8
+ {
9
+ readonly name: "linted/global/settings";
10
+ readonly plugins: import("../index.js").Plugins;
11
+ readonly linterOptions: {
12
+ readonly noInlineConfig: boolean;
13
+ readonly reportUnusedDisableDirectives: "error" | "warn" | "off";
14
+ };
15
+ readonly languageOptions: {
16
+ readonly sourceType: "module" | "script";
17
+ readonly ecmaVersion: 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | "latest" | 3 | 5;
18
+ };
19
+ },
20
+ {
21
+ readonly name: "linted/global/ignores";
22
+ readonly ignores: string[];
23
+ }
24
+ ];
25
+ }
26
+ //# sourceMappingURL=global.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global.d.ts","sourceRoot":"","sources":["../../src/factory/global.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC;AAE/B,qBAAa,MAAM;aAEC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;aACzB,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC;aAC3B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;gBAFzB,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,EACzB,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,EAC3B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IAG3C,IAAW,OAAO;;;;;;;;;;;;;;OAgCjB;CACF"}
@@ -0,0 +1,39 @@
1
+ export class Global {
2
+ plugins;
3
+ settings;
4
+ globals;
5
+ constructor(plugins, settings, globals) {
6
+ this.plugins = plugins;
7
+ this.settings = settings;
8
+ this.globals = globals;
9
+ }
10
+ get configs() {
11
+ const { plugins, settings, globals, } = this;
12
+ return [
13
+ {
14
+ name: "linted/global/settings",
15
+ plugins,
16
+ linterOptions: {
17
+ noInlineConfig: settings.noInlineConfig,
18
+ reportUnusedDisableDirectives: settings.reportUnusedDisableDirectives,
19
+ },
20
+ languageOptions: {
21
+ sourceType: settings.sourceType,
22
+ ecmaVersion: settings.ecmaVersion,
23
+ },
24
+ },
25
+ {
26
+ name: "linted/global/ignores",
27
+ ignores: typeof globals.extend.ignores === "undefined" || globals.extend.ignores.length < 1
28
+ ? globals.ignores.ignores
29
+ : [
30
+ ...globals.extend.inherit === false
31
+ ? []
32
+ : globals.ignores.ignores,
33
+ ...globals.extend.ignores,
34
+ ],
35
+ },
36
+ ];
37
+ }
38
+ }
39
+ //# sourceMappingURL=global.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global.js","sourceRoot":"","sources":["../../src/factory/global.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,MAAM;IAEC;IACA;IACA;IAHlB,YACkB,OAAyB,EACzB,QAA2B,EAC3B,OAAyB;QAFzB,YAAO,GAAP,OAAO,CAAkB;QACzB,aAAQ,GAAR,QAAQ,CAAmB;QAC3B,YAAO,GAAP,OAAO,CAAkB;IACxC,CAAC;IAEJ,IAAW,OAAO;QAChB,MAAM,EACJ,OAAO,EACP,QAAQ,EACR,OAAO,GACR,GAAG,IAAI,CAAC;QAET,OAAO;YACL;gBACE,IAAI,EAAE,wBAAwB;gBAC9B,OAAO;gBACP,aAAa,EAAE;oBACb,cAAc,EAAE,QAAQ,CAAC,cAAc;oBACvC,6BAA6B,EAAE,QAAQ,CAAC,6BAA6B;iBACtE;gBACD,eAAe,EAAE;oBACf,UAAU,EAAE,QAAQ,CAAC,UAAU;oBAC/B,WAAW,EAAE,QAAQ,CAAC,WAAW;iBAClC;aACF;YACD;gBACE,IAAI,EAAE,uBAAuB;gBAC7B,OAAO,EAAE,OAAO,OAAO,CAAC,MAAM,CAAC,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;oBACzF,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO;oBACzB,CAAC,CAAC;wBACE,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,KAAK,KAAK;4BACjC,CAAC,CAAC,EAAE;4BACJ,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO;wBAC3B,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO;qBAC1B;aACN;SACO,CAAC;IACb,CAAC;CACF"}
@@ -4,6 +4,7 @@ import { Ignores } from "./ignores.js";
4
4
  import { Rules } from "./rules/index.js";
5
5
  import Options from "./options/index.js";
6
6
  export { Options };
7
+ export { Global } from "./global.js";
7
8
  export declare class Factory {
8
9
  readonly files: Files;
9
10
  readonly ignores: Ignores;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/factory/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,KAAK,EACL,KAAK,EACL,YAAY,EACZ,SAAS,EACT,UAAU,GACX,MAAM,IAAI,CAAC;AAEZ,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,qBAAa,OAAO;IAClB,SAAgB,KAAK,EAAE,KAAK,CAAC;IAC7B,SAAgB,OAAO,EAAE,OAAO,CAAC;IACjC,SAAgB,KAAK,EAAE,KAAK,CAAC;gBAG3B,KAAK,EAAE,qBAAqB,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,EAC7C,OAAO,EAAE,qBAAqB,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,EACjD,KAAK,EAAE,qBAAqB,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IAOxC,OAAO,CAAC,KAAK,EAAE,MAAM;CAO7B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/factory/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,KAAK,EACL,KAAK,EACL,YAAY,EACZ,SAAS,EACT,UAAU,GACX,MAAM,IAAI,CAAC;AAEZ,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,qBAAa,OAAO;IAClB,SAAgB,KAAK,EAAE,KAAK,CAAC;IAC7B,SAAgB,OAAO,EAAE,OAAO,CAAC;IACjC,SAAgB,KAAK,EAAE,KAAK,CAAC;gBAG3B,KAAK,EAAE,qBAAqB,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,EAC7C,OAAO,EAAE,qBAAqB,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,EACjD,KAAK,EAAE,qBAAqB,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IAOxC,OAAO,CAAC,KAAK,EAAE,MAAM;CAO7B"}
@@ -3,6 +3,7 @@ import { Ignores } from "./ignores.js";
3
3
  import { Rules } from "./rules/index.js";
4
4
  import Options from "./options/index.js";
5
5
  export { Options };
6
+ export { Global } from "./global.js";
6
7
  export class Factory {
7
8
  files;
8
9
  ignores;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/factory/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAA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,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;IAEM,OAAO,CAAC,KAAa;QAC1B,OAAO;YACL,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;YACvB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC;YAC3B,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;SACf,CAAC;IACb,CAAC;CACF"}
package/dist/index.d.ts CHANGED
@@ -2,5 +2,5 @@ export type { Scope } from "./scopes/index.js";
2
2
  export type { Plugins, RuleEntry, RuleRecord, RuleState, GlobalConfigSystem, GlobalConfigIgnores, ScopedConfig, } from "./objects/index.js";
3
3
  import type { Input, Output } from "./interface/index.js";
4
4
  export type { Input, Output, };
5
- export default function (input: Input): Output;
5
+ export default function ({ plugins, parsers, settings, globals, files, ignores, rules, }: Input): Output;
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,YAAY,EACV,OAAO,EACP,SAAS,EACT,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,GACb,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EACV,KAAK,EACL,MAAM,EACP,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,KAAK,EACL,MAAM,GACP,CAAC;AAQF,MAAM,CAAC,OAAO,WAAW,KAAK,EAAE,KAAK,GAAG,MAAM,CAuF7C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,YAAY,EACV,OAAO,EACP,SAAS,EACT,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,GACb,MAAM,WAAW,CAAC;AAEnB,OAAO,KAAK,EACV,KAAK,EACL,MAAM,EACP,MAAM,aAAa,CAAC;AAErB,YAAY,EACV,KAAK,EACL,MAAM,GACP,CAAC;AASF,MAAM,CAAC,OAAO,WACZ,EACE,OAAO,EACP,OAAO,EACP,QAAQ,EACR,OAAO,EACP,KAAK,EACL,OAAO,EACP,KAAK,GACN,EAAE,KAAK,GACP,MAAM,CA6DR"}
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { scopes } from "./scopes/index.js";
2
- import { Factory, Options, } from "./factory/index.js";
3
- export default function (input) {
2
+ import { Global, Factory, Options, } from "./factory/index.js";
3
+ export default function ({ plugins, parsers, settings, globals, files, ignores, rules, }) {
4
4
  try {
5
- const { plugins, parsers, settings, globals, files, ignores, rules, } = input, factory = new Factory(files, ignores, rules), options = {
5
+ const global = new Global(plugins, settings, globals), factory = new Factory(files, ignores, rules), options = {
6
6
  js: new Options
7
7
  .js([], ...factory.produce("js")).configs,
8
8
  ts: new Options
@@ -21,29 +21,7 @@ export default function (input) {
21
21
  .yml([parsers.yml], ...factory.produce("yml")).configs,
22
22
  };
23
23
  return [
24
- {
25
- name: "linted/global/settings",
26
- plugins,
27
- linterOptions: {
28
- noInlineConfig: settings.noInlineConfig,
29
- reportUnusedDisableDirectives: settings.reportUnusedDisableDirectives,
30
- },
31
- languageOptions: {
32
- sourceType: settings.sourceType,
33
- ecmaVersion: settings.ecmaVersion,
34
- },
35
- },
36
- {
37
- name: "linted/global/ignores",
38
- ignores: typeof globals.extend.ignores === "undefined" || globals.extend.ignores.length < 1
39
- ? globals.ignores.ignores
40
- : [
41
- ...globals.extend.inherit === false
42
- ? []
43
- : globals.ignores.ignores,
44
- ...globals.extend.ignores,
45
- ],
46
- },
24
+ ...global.configs,
47
25
  ...scopes.flatMap(scope => options[scope]),
48
26
  ];
49
27
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EACL,OAAO,EACP,OAAO,GACR,MAAM,WAAW,CAAC;AAEnB,MAAM,CAAC,OAAO,WAAW,KAAY;IACnC,IAAI,CAAC;QACH,MAAM,EACJ,OAAO,EACP,OAAO,EACP,QAAQ,EACR,OAAO,EACP,KAAK,EACL,OAAO,EACP,KAAK,GACN,GAAG,KAAK,EACT,OAAO,GAAG,IAAI,OAAO,CACnB,KAAK,EACL,OAAO,EACP,KAAK,CACN,EACD,OAAO,GAAiF;YACtF,EAAE,EAAE,IAAI,OAAO;iBACZ,EAAE,CACD,EAAE,EACF,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CACzB,CAAC,OAAO;YACX,EAAE,EAAE,IAAI,OAAO;iBACZ,EAAE,CACD,CAAC,OAAO,CAAC,EAAE,CAAC,EACZ,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CACzB,CAAC,OAAO;YACX,MAAM,EAAE,IAAI,OAAO;iBAChB,MAAM,CACL,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,EAC5B,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAC7B,CAAC,OAAO;YACX,KAAK,EAAE,IAAI,OAAO;iBACf,KAAK,CACJ,CAAC,OAAO,CAAC,EAAE,CAAC,EACZ,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAC5B,CAAC,OAAO;YACX,IAAI,EAAE,IAAI,OAAO;iBACd,IAAI,CACH,CAAC,OAAO,CAAC,IAAI,CAAC,EACd,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAC3B,CAAC,OAAO;YACX,IAAI,EAAE,IAAI,OAAO;iBACd,IAAI,CACH,CAA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AAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAC3B,CAAC,OAAO;YACX,IAAI,EAAE,IAAI,OAAO;iBACd,IAAI,CACH,CAAC,OAAO,CAAC,KAAK,CAAC,EACf,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAC3B,CAAC,OAAO;YACX,KAAK,EAAE,IAAI,OAAO;iBACf,KAAK,CACJ,CAAC,OAAO,CAAC,KAAK,CAAC,EACf,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAC5B,CAAC,OAAO;YACX,GAAG,EAAE,IAAI,OAAO;iBACb,GAAG,CACF,CAAC,OAAO,CAAC,GAAG,CAAC,EACb,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAC1B,CAAC,OAAO;SACZ,CAAC;QAEF,OAAO;YACL,GAAG,MAAM,CAAC,OAAO;YACjB,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;SAC3C,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,EAAE,CAAC;QAAC,MAAM,IAAI,KAAK,CAAC,aAAa,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;IAAC,CAAC;AAC7D,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "_schemaVersion": "22.11.0",
3
3
  "name": "@eslinted/core",
4
- "version": "12.0.0-rc.5",
4
+ "version": "12.0.1",
5
5
  "description": "Core ESLint flat config factory npm package `linted`.",
6
6
  "keywords": [],
7
7
  "repository": "github:jimmy-zhening-luo/linted-core",
@@ -0,0 +1,43 @@
1
+ import type { Input } from ".";
2
+
3
+ export class Global {
4
+ constructor(
5
+ public readonly plugins: Input["plugins"],
6
+ public readonly settings: Input["settings"],
7
+ public readonly globals: Input["globals"],
8
+ ) {}
9
+
10
+ public get configs() {
11
+ const {
12
+ plugins,
13
+ settings,
14
+ globals,
15
+ } = this;
16
+
17
+ return [
18
+ {
19
+ name: "linted/global/settings",
20
+ plugins,
21
+ linterOptions: {
22
+ noInlineConfig: settings.noInlineConfig,
23
+ reportUnusedDisableDirectives: settings.reportUnusedDisableDirectives,
24
+ },
25
+ languageOptions: {
26
+ sourceType: settings.sourceType,
27
+ ecmaVersion: settings.ecmaVersion,
28
+ },
29
+ },
30
+ {
31
+ name: "linted/global/ignores",
32
+ ignores: typeof globals.extend.ignores === "undefined" || globals.extend.ignores.length < 1
33
+ ? globals.ignores.ignores
34
+ : [
35
+ ...globals.extend.inherit === false
36
+ ? []
37
+ : globals.ignores.ignores,
38
+ ...globals.extend.ignores,
39
+ ],
40
+ },
41
+ ] as const;
42
+ }
43
+ }
@@ -12,6 +12,7 @@ import { Rules } from "./rules";
12
12
  import Options from "./options";
13
13
 
14
14
  export { Options };
15
+ export { Global } from "./global";
15
16
  export class Factory {
16
17
  public readonly files: Files;
17
18
  public readonly ignores: Ignores;
package/src/index.ts CHANGED
@@ -21,21 +21,28 @@ export type {
21
21
 
22
22
  import { scopes } from "./scopes";
23
23
  import {
24
+ Global,
24
25
  Factory,
25
26
  Options,
26
27
  } from "./factory";
27
28
 
28
- export default function (input: Input): Output {
29
+ export default function (
30
+ {
31
+ plugins,
32
+ parsers,
33
+ settings,
34
+ globals,
35
+ files,
36
+ ignores,
37
+ rules,
38
+ }: Input,
39
+ ): Output {
29
40
  try {
30
- const {
41
+ const global = new Global(
31
42
  plugins,
32
- parsers,
33
43
  settings,
34
44
  globals,
35
- files,
36
- ignores,
37
- rules,
38
- } = input,
45
+ ),
39
46
  factory = new Factory(
40
47
  files,
41
48
  ignores,
@@ -85,29 +92,7 @@ export default function (input: Input): Output {
85
92
  };
86
93
 
87
94
  return [
88
- {
89
- name: "linted/global/settings",
90
- plugins,
91
- linterOptions: {
92
- noInlineConfig: settings.noInlineConfig,
93
- reportUnusedDisableDirectives: settings.reportUnusedDisableDirectives,
94
- },
95
- languageOptions: {
96
- sourceType: settings.sourceType,
97
- ecmaVersion: settings.ecmaVersion,
98
- },
99
- },
100
- {
101
- name: "linted/global/ignores",
102
- ignores: typeof globals.extend.ignores === "undefined" || globals.extend.ignores.length < 1
103
- ? globals.ignores.ignores
104
- : [
105
- ...globals.extend.inherit === false
106
- ? []
107
- : globals.ignores.ignores,
108
- ...globals.extend.ignores,
109
- ],
110
- },
95
+ ...global.configs,
111
96
  ...scopes.flatMap(scope => options[scope]),
112
97
  ];
113
98
  }