eslint-config-un 1.0.0-alpha.37 → 1.0.0-alpha.39
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 +20 -0
- package/dist/{angular-jIwskBI5.js → angular-CRCczcUF.mjs} +9 -15
- package/dist/{astro-Da_outEx.js → astro-XhoPuz-z.mjs} +11 -12
- package/dist/{ava-CbuzM59v.js → ava-OwYhn8_y.mjs} +6 -7
- package/dist/{better-tailwind-DemAVSYn.js → better-tailwind-ByZz7Sd6.mjs} +5 -6
- package/dist/{case-police-Bhk8VJEv.js → case-police-C3sZIDEN.mjs} +5 -6
- package/dist/{cli-RMLk3JGc.js → cli-hbW-j_lv.mjs} +5 -6
- package/dist/{cloudfront-functions-D1wIrqfc.js → cloudfront-functions-HqClYFKX.mjs} +10 -11
- package/dist/{compat-C9d_mOS4.js → compat-BV9tHeaI.mjs} +5 -6
- package/dist/{eslint-CaoFmjOr.js → configs-MInxgWEL.mjs} +500 -332
- package/dist/{cspell-lGQqbjtk.js → cspell-DkHUDsoM.mjs} +5 -6
- package/dist/{css-De4qJRx_.js → css-9JBKin_R.mjs} +15 -13
- package/dist/{css-in-js-Cej7BqH2.js → css-in-js-BIYiDDsS.mjs} +5 -6
- package/dist/{cypress-DVe3_w_r.js → cypress-DdsGCkPn.mjs} +6 -7
- package/dist/{de-morgan-pjU5aP2V.js → de-morgan-CC_DGUlf.mjs} +5 -6
- package/dist/depend-DNzNyKpV.mjs +20 -0
- package/dist/{ember-C42lASjF.js → ember-Dk9J0S2e.mjs} +7 -8
- package/dist/{erasable-syntax-only-DaJea78-.js → erasable-syntax-only-BT_HDdU1.mjs} +5 -6
- package/dist/es-CMrwlzM4.mjs +4 -0
- package/dist/{es-DeZRlxZp.js → es-gXUbQTOA.mjs} +6 -6
- package/dist/{eslint-comments-qpfwwbmo.js → eslint-comments-CP0UQmV1.mjs} +5 -6
- package/dist/{eslint-plugin-BOvCjMZX.js → eslint-plugin-B494AhC6.mjs} +7 -8
- package/dist/{file-progress-BzLxQPY2.js → file-progress-j9hP_zhB.mjs} +5 -6
- package/dist/{graphql-BIi2O_XX.js → graphql-BMVF4FMu.mjs} +10 -13
- package/dist/{header-Bi34G-RH.js → header-BGvavvsn.mjs} +5 -6
- package/dist/{headers-MDR8x3IU.js → headers-COXwQW_0.mjs} +5 -6
- package/dist/{html-D97W6cUX.js → html-B80vDkoH.mjs} +9 -13
- package/dist/{import-h_396dcB.js → import-Dz54EQgO.mjs} +15 -9
- package/dist/import-zod-BmqBWHzg.mjs +15 -0
- package/dist/{index.d.ts → index.d.mts} +2778 -1405
- package/dist/index.mjs +855 -0
- package/dist/{jest-BsPD9M1_.js → jest-Bfx5HWhf.mjs} +8 -9
- package/dist/{js-B4crsIaF.js → js-W5Io_tBI.mjs} +6 -7
- package/dist/{js-inline-B8f1KABy.js → js-inline-BYVY3-qj.mjs} +5 -6
- package/dist/{jsdoc-BqCQ7ceo.js → jsdoc-Bt9t5_b6.mjs} +6 -7
- package/dist/{json-schema-validator-CPrSL2yi.js → json-schema-validator-DxU_8gIh.mjs} +10 -9
- package/dist/jsonc-_CdrmKxb.mjs +55 -0
- package/dist/{jsx-a11y-BIdtj-0T.js → jsx-a11y-sBT6cqDs.mjs} +6 -6
- package/dist/{lit-Bi86zio0.js → lit-DRB9HxGd.mjs} +8 -9
- package/dist/{markdown-Bu2B9JBA.js → markdown-B4ZShicP.mjs} +10 -11
- package/dist/{markdown-links-Dtosgn03.js → markdown-links-D6cOa21t.mjs} +5 -6
- package/dist/{markdown-preferences-CtUU7dab.js → markdown-preferences-8MF-UvE7.mjs} +5 -6
- package/dist/{math-yhMomQz9.js → math-DfMV6REe.mjs} +5 -6
- package/dist/{mdx-BNEg3VYU.js → mdx-C6ucJvDn.mjs} +11 -15
- package/dist/{mocha-ebL0ZanK.js → mocha-soa_p0A5.mjs} +6 -7
- package/dist/{nextjs-CTe5rfzl.js → nextjs-umIBMqii.mjs} +5 -6
- package/dist/no-only-tests-Dk9tM9kT.mjs +19 -0
- package/dist/{no-stylistic-rules-BXTrGk4A.js → no-stylistic-rules-BBHLuSzD.mjs} +26 -11
- package/dist/{no-unsanitized-DX5mEwHn.js → no-unsanitized-Dk5pZh9b.mjs} +5 -6
- package/dist/node-CSSthQcZ.mjs +27 -0
- package/dist/node-dependencies-AE9gtafX.mjs +23 -0
- package/dist/nx-BinTVkZD.mjs +25 -0
- package/dist/package-json-BxW5kfHg.mjs +46 -0
- package/dist/{perfectionist-dZFLujSP.js → perfectionist-CLyGow45.mjs} +6 -7
- package/dist/{playwright-CsOnXkKa.js → playwright-DOsXiMIz.mjs} +7 -8
- package/dist/plugin-un-nASQBk8v.mjs +181 -0
- package/dist/{pnpm-B1gjfGzH.js → pnpm-D_0a5MfS.mjs} +8 -10
- package/dist/{prefer-arrow-functions-gyzpiaGM.js → prefer-arrow-functions-Bulccs4G.mjs} +5 -6
- package/dist/{promise-Ipzne7W1.js → promise-DhV-YayQ.mjs} +5 -6
- package/dist/qunit-DpPHEh8u.mjs +21 -0
- package/dist/{qwik-BgscptgR.js → qwik-DDhemNm0.mjs} +5 -6
- package/dist/{react-DJIuyUFZ.js → react-CYt-gyNA.mjs} +15 -16
- package/dist/{regexp-Buwyy1U_.js → regexp-B8yjiGMz.mjs} +5 -6
- package/dist/{rxjs-B-3F8LTT.js → rxjs-CRitF2yu.mjs} +5 -6
- package/dist/{security-Dc0QV9am.js → security-C13zxjbD.mjs} +5 -6
- package/dist/{shared-CwQIlSxu.js → shared-l-LiTgAp.mjs} +2 -2
- package/dist/{solid-B-dG48pi.js → solid-CmUVa-w6.mjs} +5 -6
- package/dist/{sonar-5F_Zk1bD.js → sonar-XwmYXLfc.mjs} +5 -6
- package/dist/{storybook-CBPG6YxU.js → storybook-BRhGtvXz.mjs} +5 -6
- package/dist/{svelte-KBhCdx3S.js → svelte-D5bips7c.mjs} +9 -10
- package/dist/{tailwind-B6XA2vS7.js → tailwind-BeexcNhK.mjs} +5 -6
- package/dist/{tanstack-query-DEP1VNgK.js → tanstack-query-kj-hjBhH.mjs} +5 -6
- package/dist/{testing-library-CAs4znmc.js → testing-library-BYWDPYLE.mjs} +6 -7
- package/dist/{toml-DP4zLwKD.js → toml-pyuSlJJH.mjs} +6 -7
- package/dist/{ts-DUkJ6VWe.js → ts-CLRhnbfg.mjs} +14 -15
- package/dist/{turbo-BMoFvFmJ.js → turbo-rzjK_esm.mjs} +5 -6
- package/dist/un-DFgA7Tx9.mjs +18 -0
- package/dist/{unicorn-CWMGFPMj.js → unicorn-DQyoCN39.mjs} +5 -6
- package/dist/{unnecessary-abstractions-DHZcd6w1.js → unnecessary-abstractions-DeXB6Pf_.mjs} +5 -6
- package/dist/{unocss-bPIUySNq.js → unocss-DCJMifQy.mjs} +5 -6
- package/dist/{unused-imports-uppJbi80.js → unused-imports-BqvcZ5w7.mjs} +6 -7
- package/dist/{vitest-BkX-b12G.js → vitest-CfByHeRc.mjs} +8 -9
- package/dist/{vue-DsZ0KmKp.js → vue-LCnyUR1h.mjs} +33 -32
- package/dist/{web-components-CBW8g8CV.js → web-components-CdRwVlqy.mjs} +5 -6
- package/dist/{yaml-DfcwBcqE.js → yaml-CF7Nr6B5.mjs} +6 -7
- package/dist/{you-dont-need-lodash-underscore-BqNDnNPc.js → you-dont-need-lodash-underscore-K6CTns4O.mjs} +5 -6
- package/dist/{zod--umO7QCQ.js → zod-Df7bTHj0.mjs} +6 -7
- package/package.json +54 -58
- package/dist/depend-JhuWBMxD.js +0 -22
- package/dist/es-7LLqqRa0.js +0 -4
- package/dist/import-zod-DX2O6xk3.js +0 -16
- package/dist/index.js +0 -554
- package/dist/jsonc-CvYnT6HG.js +0 -56
- package/dist/no-only-tests-CY4wpbd0.js +0 -20
- package/dist/node-DFVrCLqH.js +0 -24
- package/dist/node-dependencies-6ScYknDk.js +0 -25
- package/dist/nx-BeygHBpf.js +0 -26
- package/dist/package-json-BjlwK0rG.js +0 -51
- package/dist/package-json-CZDU8nEg.js +0 -4
- package/dist/plugin-un-DHcXaIGK.js +0 -66
- package/dist/qunit-CVlJZysa.js +0 -22
- package/dist/un-BuSNm_dA.js +0 -19
package/README.md
CHANGED
|
@@ -103,6 +103,7 @@ yarn add -D https://registry.npmjs.org/eslint-config-un/-/eslint-config-un-<VERS
|
|
|
103
103
|
| `vue` | `eslint-plugin-vue` |
|
|
104
104
|
| `vue-scoped-css` | `eslint-plugin-vue-scoped-css` |
|
|
105
105
|
| `vuejs-accessibility` | `eslint-plugin-vuejs-accessibility` |
|
|
106
|
+
| `zod` | `eslint-plugin-zod-x` |
|
|
106
107
|
|
|
107
108
|
</details>
|
|
108
109
|
|
|
@@ -543,6 +544,25 @@ It can also be enabled by setting `ESLINT_CONFIG_UN_OFFLINE_MODE` environment va
|
|
|
543
544
|
|
|
544
545
|
Allows to override certain [`eslint-plugin-import-x`] plugin rules with implementations from [`eslint-plugin-fast-import`](https://npmjs.com/eslint-plugin-fast-import).
|
|
545
546
|
|
|
547
|
+
### `cacheConfigs`
|
|
548
|
+
|
|
549
|
+
Enables flat config caching. This option is enabled by default when running in editor (detected by [`is-in-editor`](https://npmjs.com/is-in-editor)). It can also be enabled by setting `ESLINT_CONFIG_UN_CACHE_CONFIGS` environment variable to non-empty string, but the explicitly passed value takes precedence.
|
|
550
|
+
|
|
551
|
+
Note that caching might fail if the config contains unserializable data, such as functions.
|
|
552
|
+
|
|
553
|
+
Cache will be stored in `node_modules/.cache/eslint-config-un/config.json` and considered fresh for 1 hour, unless one of the following is changed:
|
|
554
|
+
|
|
555
|
+
- Current git revision (`git rev-parse HEAD`) or root `.gitignore` contents
|
|
556
|
+
- `package.json`, lockfile contents or package manager
|
|
557
|
+
- ESLint config file contents
|
|
558
|
+
- Node.JS version
|
|
559
|
+
|
|
560
|
+
### `extraPlugins`
|
|
561
|
+
|
|
562
|
+
Allows to provide additional ESLint plugins. Their prefixes and possibly rule names will appear in configs' `rules` property type. They will be lazy-loaded only if used.
|
|
563
|
+
|
|
564
|
+
Note that their prefixes must not match the built-it/known ones (like `ts` or `unicorn`) or even prefixes you've renamed via `pluginRenames`.
|
|
565
|
+
|
|
546
566
|
## FAQ
|
|
547
567
|
|
|
548
568
|
### How do I add my own flat configs?
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as assignDefaults, E as GLOB_HTML, J as OFF, N as GLOB_JS_TS_X, Z as WARNING, d as generatePackageToLoadProperty, g as pluginsLoaders, rt as fetchPackageInfo, y as ERROR } from "./configs-MInxgWEL.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/configs/angular.ts
|
|
4
4
|
const SUPPORTED_ANGULAR_VERSIONS = [
|
|
@@ -12,8 +12,7 @@ const SUPPORTED_ANGULAR_VERSIONS = [
|
|
|
12
12
|
20
|
|
13
13
|
];
|
|
14
14
|
const LATEST_SUPPORTED_ANGULAR_VERSION = SUPPORTED_ANGULAR_VERSIONS.at(-1);
|
|
15
|
-
|
|
16
|
-
const optionsRaw = context.rootOptions.configs?.angular;
|
|
15
|
+
var angular_default = (async (context, optionsRaw) => {
|
|
17
16
|
const optionsResolved = assignDefaults(optionsRaw, {
|
|
18
17
|
configTemplate: true,
|
|
19
18
|
processInlineTemplates: true,
|
|
@@ -40,18 +39,13 @@ const angularUnConfig = async (context) => {
|
|
|
40
39
|
queries: true,
|
|
41
40
|
...optionsResolved.forbiddenMetadataProperties
|
|
42
41
|
};
|
|
43
|
-
const configBuilderGeneral = createConfigBuilder(
|
|
44
|
-
const [angularEslintPlugin, angularEslintPluginPackageInfo, angularTemplateEslintPlugin, angularTemplateEslintPluginPackageInfo, angularTemplateParserPackageInfo
|
|
42
|
+
const configBuilderGeneral = context.createConfigBuilder(optionsResolved, "@angular-eslint");
|
|
43
|
+
const [angularEslintPlugin, angularEslintPluginPackageInfo, angularTemplateEslintPlugin, angularTemplateEslintPluginPackageInfo, angularTemplateParserPackageInfo] = await Promise.all([
|
|
45
44
|
pluginsLoaders["@angular-eslint"](context).then(({ module }) => module),
|
|
46
45
|
fetchPackageInfo("@angular-eslint/eslint-plugin"),
|
|
47
46
|
pluginsLoaders["@angular-eslint/template"](context).then(({ module }) => module),
|
|
48
47
|
fetchPackageInfo("@angular-eslint/eslint-plugin-template"),
|
|
49
|
-
fetchPackageInfo("@angular-eslint/template-parser")
|
|
50
|
-
interopDefault(import("@angular-eslint/eslint-plugin-template")).then((m) => m.processors["extract-inline-html"]).then((processor) => {
|
|
51
|
-
const fixedProcessor = cloneDeep(processor);
|
|
52
|
-
fixedProcessor.meta ||= { name: "extract-inline-html" };
|
|
53
|
-
return fixedProcessor;
|
|
54
|
-
})
|
|
48
|
+
fetchPackageInfo("@angular-eslint/template-parser")
|
|
55
49
|
]);
|
|
56
50
|
[
|
|
57
51
|
[angularEslintPluginPackageInfo, "@angular-eslint/eslint-plugin"],
|
|
@@ -65,7 +59,7 @@ const angularUnConfig = async (context) => {
|
|
|
65
59
|
configBuilderGeneral?.addConfig(["angular/general", {
|
|
66
60
|
includeDefaultFilesAndIgnores: true,
|
|
67
61
|
filesFallback: [GLOB_JS_TS_X]
|
|
68
|
-
}], { ...processInlineTemplates &&
|
|
62
|
+
}], { ...processInlineTemplates && generatePackageToLoadProperty("processor", "angularExtractInlineHtmlProcessor") }).addRule(...getPluginRuleSeverity("component-class-suffix", componentClassSuffixes.length === 0 ? OFF : ERROR), [{ ...componentClassSuffixes.length > 0 && { suffixes: componentClassSuffixes } }]).addRule(...getPluginRuleSeverity("component-max-inline-declarations", OFF)).addRule(...getPluginRuleSeverity("component-selector", componentSelector === false ? OFF : ERROR), [{
|
|
69
63
|
type: ["element"],
|
|
70
64
|
style: "kebab-case",
|
|
71
65
|
...typeof componentSelector === "object" && componentSelector
|
|
@@ -83,7 +77,7 @@ const angularUnConfig = async (context) => {
|
|
|
83
77
|
requireLoopIndexes: false
|
|
84
78
|
});
|
|
85
79
|
const a11yRulesSeverity = a11yRules === true ? ERROR : a11yRules === "warn" ? WARNING : OFF;
|
|
86
|
-
const configBuilderTemplate = createConfigBuilder(
|
|
80
|
+
const configBuilderTemplate = context.createConfigBuilder(configTemplate, "@angular-eslint/template");
|
|
87
81
|
configBuilderTemplate?.addConfig(["angular/template", {
|
|
88
82
|
includeDefaultFilesAndIgnores: true,
|
|
89
83
|
filesFallback: [GLOB_HTML],
|
|
@@ -94,7 +88,7 @@ const angularUnConfig = async (context) => {
|
|
|
94
88
|
configs: [configBuilderGeneral, configBuilderTemplate],
|
|
95
89
|
optionsResolved
|
|
96
90
|
};
|
|
97
|
-
};
|
|
91
|
+
});
|
|
98
92
|
|
|
99
93
|
//#endregion
|
|
100
|
-
export {
|
|
94
|
+
export { angular_default as default };
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as assignDefaults, J as OFF, Z as WARNING, b as GLOB_ASTRO, d as generatePackageToLoadProperty, g as pluginsLoaders, y as ERROR } from "./configs-MInxgWEL.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/configs/astro.ts
|
|
4
4
|
const DEFAULT_ASTRO_FILES = [GLOB_ASTRO];
|
|
5
|
-
|
|
6
|
-
const
|
|
5
|
+
var astro_default = (async (context, optionsRaw) => {
|
|
6
|
+
const eslintPluginAstro = await pluginsLoaders.astro(context).then(({ module }) => module);
|
|
7
7
|
context.usedPlugins.add("astro");
|
|
8
8
|
if (!eslintPluginAstro) return null;
|
|
9
|
-
const optionsRaw = context.rootOptions.configs?.astro;
|
|
10
9
|
const optionsResolved = assignDefaults(optionsRaw, {
|
|
11
10
|
files: DEFAULT_ASTRO_FILES,
|
|
12
11
|
configJsxA11y: true
|
|
13
12
|
});
|
|
14
13
|
const { files: parentConfigFiles, ignores: parentConfigIgnores, configJsxA11y } = optionsResolved;
|
|
15
|
-
const configBuilder = createConfigBuilder(
|
|
14
|
+
const configBuilder = context.createConfigBuilder(optionsResolved, "astro");
|
|
16
15
|
const isTypescriptEnabled = context.configsMeta.ts.enabled;
|
|
17
16
|
configBuilder?.addConfig(["astro/setup", {
|
|
18
17
|
filesFallback: [...DEFAULT_ASTRO_FILES, ...parentConfigFiles],
|
|
@@ -21,10 +20,10 @@ const astroUnConfig = async (context) => {
|
|
|
21
20
|
}], {
|
|
22
21
|
languageOptions: {
|
|
23
22
|
globals: eslintPluginAstro.environments.astro.globals,
|
|
24
|
-
parserOptions: {
|
|
23
|
+
parserOptions: { ...isTypescriptEnabled && generatePackageToLoadProperty("parser", "typescriptEslintParser") },
|
|
25
24
|
sourceType: "module"
|
|
26
25
|
},
|
|
27
|
-
...isTypescriptEnabled &&
|
|
26
|
+
...isTypescriptEnabled && generatePackageToLoadProperty("processor", "astroClientSideTsProcessor")
|
|
28
27
|
});
|
|
29
28
|
configBuilder?.addConfig(["astro", {
|
|
30
29
|
doNotIgnoreMarkdown: true,
|
|
@@ -33,19 +32,19 @@ const astroUnConfig = async (context) => {
|
|
|
33
32
|
}]).markCategory("Possible Errors").addRule("missing-client-only-directive-value", ERROR).addRule("no-conflict-set-directives", ERROR).addRule("no-deprecated-astro-canonicalurl", ERROR).addRule("no-deprecated-astro-fetchcontent", ERROR).addRule("no-deprecated-astro-resolve", ERROR).addRule("no-deprecated-getentrybyslug", ERROR).addRule("no-exports-from-components", ERROR).addRule("no-unused-define-vars-in-style", ERROR).addRule("valid-compile", ERROR).markCategory("Security Vulnerability").addRule("no-set-html-directive", ERROR).addRule("no-unsafe-inline-scripts", ERROR).markCategory("Best Practices").addRule("no-set-text-directive", OFF).addRule("no-unused-css-selector", WARNING).markCategory("Stylistic Issues").addRule("prefer-class-list-directive", ERROR).addRule("prefer-object-class-list", ERROR).addRule("prefer-split-class-list", ERROR).addRule("sort-attributes", ERROR).markCategory("Extension Rules").addRule("semi", OFF).enableConfigTesterForPlugin("astro", { rulesToSkipInConfig: (ruleName) => ruleName.startsWith("jsx-a11y/") }).addOverrides();
|
|
34
33
|
return {
|
|
35
34
|
configs: [configBuilder, ...configJsxA11y === false ? [] : await (async () => {
|
|
36
|
-
const { jsxA11yUnConfig } = await import("./jsx-a11y-
|
|
37
|
-
return
|
|
35
|
+
const { default: jsxA11yUnConfig } = await import("./jsx-a11y-sBT6cqDs.mjs");
|
|
36
|
+
return jsxA11yUnConfig(context, void 0, {
|
|
38
37
|
prefix: "astro",
|
|
39
38
|
options: {
|
|
40
39
|
files: parentConfigFiles,
|
|
41
40
|
ignores: parentConfigIgnores,
|
|
42
41
|
...typeof configJsxA11y === "object" && configJsxA11y
|
|
43
42
|
}
|
|
44
|
-
})
|
|
43
|
+
}).configs;
|
|
45
44
|
})()],
|
|
46
45
|
optionsResolved
|
|
47
46
|
};
|
|
48
|
-
};
|
|
47
|
+
});
|
|
49
48
|
|
|
50
49
|
//#endregion
|
|
51
|
-
export {
|
|
50
|
+
export { astro_default as default };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as generateDefaultTestFiles, o as generateConfigNoOnlyTestsBuilder, r as RULES_TO_DISABLE_IN_TEST_FILES } from "./shared-
|
|
1
|
+
import { $ as assignDefaults, J as OFF, P as GLOB_JS_TS_X_EXTENSION, Z as WARNING, y as ERROR } from "./configs-MInxgWEL.mjs";
|
|
2
|
+
import { c as generateDefaultTestFiles, o as generateConfigNoOnlyTestsBuilder, r as RULES_TO_DISABLE_IN_TEST_FILES } from "./shared-l-LiTgAp.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/configs/ava.ts
|
|
5
|
-
|
|
6
|
-
const optionsRaw = context.rootOptions.configs?.ava;
|
|
5
|
+
var ava_default = ((context, optionsRaw) => {
|
|
7
6
|
const optionsResolved = assignDefaults(optionsRaw, { configNoOnlyTests: false });
|
|
8
7
|
const { configNoOnlyTests, enforceAssertionMessage, enforceMaxAssertions } = optionsResolved;
|
|
9
|
-
const configBuilder = createConfigBuilder(
|
|
8
|
+
const configBuilder = context.createConfigBuilder(optionsResolved, "ava");
|
|
10
9
|
const configFilesFallback = generateDefaultTestFiles(GLOB_JS_TS_X_EXTENSION);
|
|
11
10
|
configBuilder?.addConfig(["ava", {
|
|
12
11
|
includeDefaultFilesAndIgnores: true,
|
|
@@ -16,7 +15,7 @@ const avaUnConfig = (context) => {
|
|
|
16
15
|
configs: [configBuilder, generateConfigNoOnlyTestsBuilder(context, "ava", configNoOnlyTests, optionsResolved, { filesFallback: configFilesFallback })],
|
|
17
16
|
optionsResolved
|
|
18
17
|
};
|
|
19
|
-
};
|
|
18
|
+
});
|
|
20
19
|
|
|
21
20
|
//#endregion
|
|
22
|
-
export {
|
|
21
|
+
export { ava_default as default };
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as assignDefaults, J as OFF, Z as WARNING, y as ERROR } from "./configs-MInxgWEL.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/configs/better-tailwind.ts
|
|
4
|
-
|
|
5
|
-
const optionsRaw = context.rootOptions.configs?.betterTailwind;
|
|
4
|
+
var better_tailwind_default = ((context, optionsRaw) => {
|
|
6
5
|
const optionsResolved = assignDefaults(optionsRaw, { classOrder: "official" });
|
|
7
6
|
const { settings: pluginSettings, breakUpClassesIntoMultipleLines, classOrder, restrictedClasses } = optionsResolved;
|
|
8
7
|
const tailwindRealMajorVersion = context.packagesInfo.tailwindcss?.versions.major;
|
|
9
8
|
const tailwindMajorVersion = tailwindRealMajorVersion === 3 ? 3 : 4;
|
|
10
9
|
if (tailwindRealMajorVersion === 4 && !pluginSettings?.entryPoint) context.logger.warn("[betterTailwind] You haven't specified `settings.entryPoint` option which is required for `eslint-plugin-better-tailwindcss` to work properly with Tailwind 4");
|
|
11
10
|
if (tailwindRealMajorVersion != null && (tailwindRealMajorVersion < 3 || tailwindRealMajorVersion > 4)) context.logger.warn("[betterTailwind] The detected Tailwind version is not supported by `eslint-plugin-better-tailwindcss`");
|
|
12
|
-
const configBuilder = createConfigBuilder(
|
|
11
|
+
const configBuilder = context.createConfigBuilder(optionsResolved, "better-tailwindcss");
|
|
13
12
|
configBuilder?.addConfig(["better-tailwindcss", { includeDefaultFilesAndIgnores: true }], { ...pluginSettings && { settings: { "better-tailwindcss": pluginSettings } } }).markCategory("Stylistic rules").addRule("enforce-consistent-class-order", typeof classOrder === "string" ? WARNING : OFF, typeof classOrder === "string" ? [{ order: classOrder }] : []).addRule("enforce-consistent-important-position", ERROR, [{ position: tailwindMajorVersion === 3 ? "legacy" : "recommended" }]).addRule("enforce-consistent-line-wrapping", breakUpClassesIntoMultipleLines ? WARNING : OFF, breakUpClassesIntoMultipleLines ? [breakUpClassesIntoMultipleLines] : []).addRule("enforce-consistent-variable-syntax", tailwindMajorVersion === 3 ? OFF : WARNING).addRule("enforce-shorthand-classes", ERROR, []).addRule("no-deprecated-classes", WARNING).addRule("no-duplicate-classes", WARNING).addRule("no-unnecessary-whitespace", WARNING).markCategory("Correctness rules").addRule("no-conflicting-classes", ERROR).addRule("no-restricted-classes", restrictedClasses?.length ? ERROR : OFF, restrictedClasses?.length ? [{ restrict: restrictedClasses }] : []).addRule("no-unregistered-classes", OFF).enableConfigTesterForPlugin("better-tailwindcss").addOverrides();
|
|
14
13
|
return {
|
|
15
14
|
configs: [configBuilder],
|
|
16
15
|
optionsResolved
|
|
17
16
|
};
|
|
18
|
-
};
|
|
17
|
+
});
|
|
19
18
|
|
|
20
19
|
//#endregion
|
|
21
|
-
export {
|
|
20
|
+
export { better_tailwind_default as default };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as assignDefaults, y as ERROR } from "./configs-MInxgWEL.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/configs/case-police.ts
|
|
4
|
-
|
|
5
|
-
const optionsRaw = context.rootOptions.configs?.casePolice;
|
|
4
|
+
var case_police_default = ((context, optionsRaw) => {
|
|
6
5
|
const optionsResolved = assignDefaults(optionsRaw, {});
|
|
7
|
-
const configBuilder = createConfigBuilder(
|
|
6
|
+
const configBuilder = context.createConfigBuilder(optionsResolved, "case-police");
|
|
8
7
|
configBuilder?.addConfig(["case-police", {
|
|
9
8
|
includeDefaultFilesAndIgnores: true,
|
|
10
9
|
doNotIgnoreCss: true,
|
|
@@ -16,7 +15,7 @@ const casePoliceUnConfig = (context) => {
|
|
|
16
15
|
configs: [configBuilder],
|
|
17
16
|
optionsResolved
|
|
18
17
|
};
|
|
19
|
-
};
|
|
18
|
+
});
|
|
20
19
|
|
|
21
20
|
//#endregion
|
|
22
|
-
export {
|
|
21
|
+
export { case_police_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as assignDefaults, M as GLOB_JS_TS_EXTENSION, y as ERROR } from "./configs-MInxgWEL.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/configs/extra/cli.ts
|
|
4
4
|
const DEFAULT_CLI_DIRS = [
|
|
@@ -7,11 +7,10 @@ const DEFAULT_CLI_DIRS = [
|
|
|
7
7
|
"cli"
|
|
8
8
|
];
|
|
9
9
|
const DEFAULT_CLI_FILES = ["cli"];
|
|
10
|
-
|
|
11
|
-
const optionsRaw = context.rootOptions.configs?.cli;
|
|
10
|
+
var cli_default = ((context, optionsRaw) => {
|
|
12
11
|
const optionsResolved = assignDefaults(optionsRaw, {});
|
|
13
12
|
const { onlyTopLevelDirs } = optionsResolved;
|
|
14
|
-
const configBuilder = createConfigBuilder(
|
|
13
|
+
const configBuilder = context.createConfigBuilder(optionsResolved, null);
|
|
15
14
|
configBuilder?.addConfig(["cli", {
|
|
16
15
|
includeDefaultFilesAndIgnores: true,
|
|
17
16
|
filesFallback: [...DEFAULT_CLI_DIRS.map((dir) => `${onlyTopLevelDirs ? "" : "**/"}${dir}/**/*.${GLOB_JS_TS_EXTENSION}`), ...DEFAULT_CLI_FILES.map((file) => `${onlyTopLevelDirs ? "" : "**/"}${file}.${GLOB_JS_TS_EXTENSION}`)]
|
|
@@ -20,7 +19,7 @@ const cliUnConfig = (context) => {
|
|
|
20
19
|
configs: [configBuilder],
|
|
21
20
|
optionsResolved
|
|
22
21
|
};
|
|
23
|
-
};
|
|
22
|
+
});
|
|
24
23
|
|
|
25
24
|
//#endregion
|
|
26
|
-
export {
|
|
25
|
+
export { cli_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
1
|
+
import { $ as assignDefaults, J as OFF, y as ERROR } from "./configs-MInxgWEL.mjs";
|
|
2
|
+
import { t as es_default } from "./es-gXUbQTOA.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/configs/extra/cloudfront-functions.ts
|
|
5
5
|
const genSyntaxNotAllowedErrorMessage = (syntax, isPlural = false) => `${syntax} ${isPlural ? "are" : "is"} not allowed in CloudFront functions`;
|
|
@@ -8,15 +8,14 @@ const getAllowedImports = (isV2 = true) => [
|
|
|
8
8
|
"crypto",
|
|
9
9
|
isV2 && "cloudfront"
|
|
10
10
|
].filter((v) => typeof v === "string");
|
|
11
|
-
|
|
12
|
-
const optionsRaw = context.rootOptions.configs?.cloudfrontFunctions;
|
|
11
|
+
var cloudfront_functions_default = ((context, optionsRaw) => {
|
|
13
12
|
const optionsResolved = assignDefaults(optionsRaw, {});
|
|
14
13
|
return {
|
|
15
|
-
configs:
|
|
14
|
+
configs: [[1, optionsResolved.configV1 || {}], [2, optionsResolved]].flatMap(([runtimeVersion, options]) => {
|
|
16
15
|
const isV2 = runtimeVersion === 2;
|
|
17
16
|
const { files, ignores } = options;
|
|
18
17
|
if (!files?.length && !ignores?.length) return [];
|
|
19
|
-
const configsEs = (
|
|
18
|
+
const configsEs = es_default(context, void 0, {
|
|
20
19
|
prefix: `cloudfront-functions/v${runtimeVersion}/es-features`,
|
|
21
20
|
options: {
|
|
22
21
|
files,
|
|
@@ -94,9 +93,9 @@ const cloudfrontFunctionsEslintConfig = async (context) => {
|
|
|
94
93
|
}
|
|
95
94
|
}
|
|
96
95
|
}
|
|
97
|
-
})
|
|
96
|
+
}).configs;
|
|
98
97
|
const allowedImports = getAllowedImports(isV2);
|
|
99
|
-
const configBuilder = createConfigBuilder(
|
|
98
|
+
const configBuilder = context.createConfigBuilder(options, "");
|
|
100
99
|
configBuilder?.addConfig([`cloudfront-functions/v${runtimeVersion}`, { includeDefaultFilesAndIgnores: true }]).addAnyRule("", "no-unused-vars", ERROR, [{ varsIgnorePattern: "^handler$" }]).addRule("no-var", isV2 ? null : OFF).addRule("prefer-destructuring", OFF).addRule("prefer-object-has-own", OFF).addRule("vars-on-top", isV2 ? null : OFF).addAnyRule("unicorn", "prefer-logical-operator-over-ternary", OFF).addAnyRule("node", "prefer-node-protocol", OFF).addRule("no-restricted-syntax", ERROR, [
|
|
101
100
|
{
|
|
102
101
|
selector: "ExportNamedDeclaration",
|
|
@@ -145,10 +144,10 @@ const cloudfrontFunctionsEslintConfig = async (context) => {
|
|
|
145
144
|
}
|
|
146
145
|
]).addAnyRule("node", "no-missing-import", ERROR, [{ allowModules: allowedImports }]).addAnyRule("node", "no-missing-require", ERROR, [{ allowModules: allowedImports }]).addOverrides();
|
|
147
146
|
return [...configsEs, configBuilder];
|
|
148
|
-
})
|
|
147
|
+
}),
|
|
149
148
|
optionsResolved
|
|
150
149
|
};
|
|
151
|
-
};
|
|
150
|
+
});
|
|
152
151
|
|
|
153
152
|
//#endregion
|
|
154
|
-
export {
|
|
153
|
+
export { cloudfront_functions_default as default };
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $ as assignDefaults, y as ERROR } from "./configs-MInxgWEL.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/configs/compat.ts
|
|
4
|
-
|
|
5
|
-
const optionsRaw = context.rootOptions.configs?.compat;
|
|
4
|
+
var compat_default = ((context, optionsRaw) => {
|
|
6
5
|
const optionsResolved = assignDefaults(optionsRaw, {});
|
|
7
6
|
const { settings: pluginSettings } = optionsResolved;
|
|
8
|
-
const configBuilder = createConfigBuilder(
|
|
7
|
+
const configBuilder = context.createConfigBuilder(optionsResolved, "compat");
|
|
9
8
|
configBuilder?.addConfig(["compat", { includeDefaultFilesAndIgnores: true }], { ...pluginSettings && { settings: pluginSettings } }).addRule("compat", ERROR).enableConfigTesterForPlugin("compat").addOverrides();
|
|
10
9
|
return {
|
|
11
10
|
configs: [configBuilder],
|
|
12
11
|
optionsResolved
|
|
13
12
|
};
|
|
14
|
-
};
|
|
13
|
+
});
|
|
15
14
|
|
|
16
15
|
//#endregion
|
|
17
|
-
export {
|
|
16
|
+
export { compat_default as default };
|