@jsse/eslint-config 0.8.7 → 0.9.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/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/dist/cli.js +1 -1
- package/dist/fixable-rules-map-B2-5HybI.js +661 -0
- package/dist/fixable-rules-map-CvRdO-mG.d.ts +16614 -0
- package/dist/fixable.d.ts +6 -0
- package/dist/fixable.js +5 -0
- package/dist/index.d.ts +4 -16610
- package/dist/index.js +10 -46
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +22 -8
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { n as __exportAll, r as __toESM, t as __commonJSMin } from "./rolldown-runtime-DJK8HYOj.js";
|
|
2
|
+
import { t as FIXABLE_RULES_MAP } from "./fixable-rules-map-B2-5HybI.js";
|
|
2
3
|
import { builtinModules, createRequire } from "node:module";
|
|
3
4
|
import fs, { realpathSync, statSync } from "node:fs";
|
|
4
5
|
import process$1 from "node:process";
|
|
@@ -27,7 +28,7 @@ import assert from "node:assert";
|
|
|
27
28
|
import v8 from "node:v8";
|
|
28
29
|
import { format, inspect } from "node:util";
|
|
29
30
|
//#region src/_generated/version.ts
|
|
30
|
-
const VERSION = "0.
|
|
31
|
+
const VERSION = "0.9.0";
|
|
31
32
|
//#endregion
|
|
32
33
|
//#region src/globs.ts
|
|
33
34
|
var globs_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -451,28 +452,6 @@ const reactHooks = async () => {
|
|
|
451
452
|
}];
|
|
452
453
|
};
|
|
453
454
|
//#endregion
|
|
454
|
-
//#region src/configs/ts/typescript-language-options.ts
|
|
455
|
-
function typescriptLanguageOptions(options) {
|
|
456
|
-
const { componentExts = [], react, tsconfig } = options;
|
|
457
|
-
const tsOptions = tsconfig ? {
|
|
458
|
-
project: Array.isArray(tsconfig) ? tsconfig : [tsconfig],
|
|
459
|
-
tsconfigRootDir: process$1.cwd()
|
|
460
|
-
} : {};
|
|
461
|
-
return {
|
|
462
|
-
parser: parserTs,
|
|
463
|
-
parserOptions: {
|
|
464
|
-
ecmaFeatures: react ? {
|
|
465
|
-
jsx: true,
|
|
466
|
-
modules: true
|
|
467
|
-
} : void 0,
|
|
468
|
-
extraFileExtensions: componentExts.map((ext) => `.${ext}`),
|
|
469
|
-
sourceType: "module",
|
|
470
|
-
...tsOptions,
|
|
471
|
-
jsxPragma: react ? "React" : void 0
|
|
472
|
-
}
|
|
473
|
-
};
|
|
474
|
-
}
|
|
475
|
-
//#endregion
|
|
476
455
|
//#region src/configs/eslint-react.ts
|
|
477
456
|
async function importReactPlugins() {
|
|
478
457
|
const [pluginReact, pluginReactRefresh] = await Promise.all([interopDefault(import("@eslint-react/eslint-plugin")), interopDefault(import("eslint-plugin-react-refresh"))]);
|
|
@@ -482,7 +461,7 @@ async function importReactPlugins() {
|
|
|
482
461
|
};
|
|
483
462
|
}
|
|
484
463
|
const eslintReact = async (options) => {
|
|
485
|
-
const {
|
|
464
|
+
const { overrides = {}, reactRefresh } = options ?? {};
|
|
486
465
|
const { pluginReact, pluginReactRefresh } = await importReactPlugins();
|
|
487
466
|
const coreReactPlugins = pluginReact.configs.all.plugins?.["@eslint-react"];
|
|
488
467
|
if (!coreReactPlugins) throw new Error("coreReactPlugins is undefined");
|
|
@@ -490,12 +469,6 @@ const eslintReact = async (options) => {
|
|
|
490
469
|
const config = [
|
|
491
470
|
{
|
|
492
471
|
files: [GLOB_SRC],
|
|
493
|
-
languageOptions: typescriptLanguageOptions({
|
|
494
|
-
componentExts,
|
|
495
|
-
parserOptions,
|
|
496
|
-
react,
|
|
497
|
-
tsconfig
|
|
498
|
-
}),
|
|
499
472
|
name: "jsse/react/setup",
|
|
500
473
|
plugins: {
|
|
501
474
|
"@eslint-react": coreReactPlugins,
|
|
@@ -5768,7 +5741,7 @@ function autoUseParserService(options) {
|
|
|
5768
5741
|
return !!(options.tsconfig && (typeof options.tsconfig === "string" && options.tsconfig === "tsconfig.json" || Array.isArray(options.tsconfig) && options.tsconfig.length === 1 && options.tsconfig[0] === "tsconfig.json"));
|
|
5769
5742
|
}
|
|
5770
5743
|
function typescriptParser(options) {
|
|
5771
|
-
const { componentExts = [], filesTypeAware: files = [GLOB_TS, GLOB_TSX], ignoresTypeAware: ignores = [GLOB_MARKDOWN], name, parserOptions: parserOptionsOverride = {},
|
|
5744
|
+
const { componentExts = [], filesTypeAware: files = [GLOB_TS, GLOB_TSX], ignoresTypeAware: ignores = [GLOB_MARKDOWN], name, parserOptions: parserOptionsOverride = {}, tsconfig, typeAware: typeAwareOpt, useProjectService = autoUseParserService(options) } = options;
|
|
5772
5745
|
const typeAware = typeAwareOpt === void 0 ? !!tsconfig : typeAwareOpt;
|
|
5773
5746
|
if (useProjectService) {
|
|
5774
5747
|
dbg("ts parser-options using `projectService`project service");
|
|
@@ -5779,14 +5752,13 @@ function typescriptParser(options) {
|
|
|
5779
5752
|
parser: parserTs,
|
|
5780
5753
|
parserOptions: {
|
|
5781
5754
|
extraFileExtensions: componentExts.map((ext) => `.${ext}`),
|
|
5782
|
-
jsxPragma: react ? "React" : void 0,
|
|
5783
5755
|
sourceType: "module",
|
|
5784
5756
|
...typeAware && {
|
|
5785
5757
|
projectService: {
|
|
5786
5758
|
allowDefaultProject: ["./*.js"],
|
|
5787
5759
|
defaultProject: (typeof tsconfig === "string" ? tsconfig : tsconfig?.[0]) ?? "tsconfig.json"
|
|
5788
5760
|
},
|
|
5789
|
-
tsconfigRootDir: process$1.cwd()
|
|
5761
|
+
tsconfigRootDir: process$1.cwd().replaceAll("\\", "/")
|
|
5790
5762
|
},
|
|
5791
5763
|
...parserOptionsOverride
|
|
5792
5764
|
}
|
|
@@ -5802,7 +5774,6 @@ function typescriptParser(options) {
|
|
|
5802
5774
|
parser: parserTs,
|
|
5803
5775
|
parserOptions: {
|
|
5804
5776
|
extraFileExtensions: componentExts.map((ext) => `.${ext}`),
|
|
5805
|
-
jsxPragma: react ? "React" : void 0,
|
|
5806
5777
|
sourceType: "module",
|
|
5807
5778
|
...typeAware && {
|
|
5808
5779
|
project: Array.isArray(tsconfig) ? tsconfig : [tsconfig],
|
|
@@ -5818,26 +5789,24 @@ function typescriptParser(options) {
|
|
|
5818
5789
|
//#region src/configs/ts/typescript.ts
|
|
5819
5790
|
const typescript = async (options) => {
|
|
5820
5791
|
dbg("typescript-options: %O", options);
|
|
5821
|
-
const { componentExts = [], filesTypeAware = [GLOB_TS, GLOB_TSX], ignoresTypeAware = [GLOB_MARKDOWN], overrides = {}, overridesTypeAware = {}, parserOptions = {}, prefix,
|
|
5792
|
+
const { componentExts = [], filesTypeAware = [GLOB_TS, GLOB_TSX], ignoresTypeAware = [GLOB_MARKDOWN], overrides = {}, overridesTypeAware = {}, parserOptions = {}, prefix, strict = false, tsconfig: tsconfigPath, typeAware = true } = options ?? {};
|
|
5793
|
+
const hasCustomTypeAwareScope = options?.filesTypeAware !== void 0 || options?.ignoresTypeAware !== void 0;
|
|
5822
5794
|
const parserConfigs = typeAware ? [typescriptParser({
|
|
5823
5795
|
filesTypeAware,
|
|
5824
5796
|
ignoresTypeAware,
|
|
5825
5797
|
parserOptions,
|
|
5826
|
-
react,
|
|
5827
5798
|
tsconfig: tsconfigPath,
|
|
5828
5799
|
typeAware: true
|
|
5829
|
-
}), typescriptParser({
|
|
5800
|
+
}), ...hasCustomTypeAwareScope ? [typescriptParser({
|
|
5830
5801
|
filesTypeAware,
|
|
5831
5802
|
ignoresTypeAware,
|
|
5832
5803
|
parserOptions,
|
|
5833
|
-
react,
|
|
5834
5804
|
tsconfig: tsconfigPath,
|
|
5835
5805
|
typeAware: false
|
|
5836
|
-
})] : [typescriptParser({
|
|
5806
|
+
})] : []] : [typescriptParser({
|
|
5837
5807
|
filesTypeAware,
|
|
5838
5808
|
ignoresTypeAware,
|
|
5839
5809
|
parserOptions,
|
|
5840
|
-
react,
|
|
5841
5810
|
tsconfig: tsconfigPath,
|
|
5842
5811
|
typeAware: false
|
|
5843
5812
|
})];
|
|
@@ -12840,7 +12809,6 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
12840
12809
|
from: "@typescript-eslint",
|
|
12841
12810
|
to: tsPrefix ?? "@typescript-eslint"
|
|
12842
12811
|
},
|
|
12843
|
-
react: !!enableReact,
|
|
12844
12812
|
typeAware: effectiveTypeAware
|
|
12845
12813
|
});
|
|
12846
12814
|
configs.push(tscfg);
|
|
@@ -12857,11 +12825,7 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
12857
12825
|
configs.push(ymlConfig);
|
|
12858
12826
|
}
|
|
12859
12827
|
if (enableReact) configs.push(eslintReact({
|
|
12860
|
-
componentExts,
|
|
12861
|
-
parserOptions: normalizedOptions.parserOptions,
|
|
12862
|
-
...typeof typescriptOptions === "object" && { tsconfig: typescriptOptions.tsconfig },
|
|
12863
12828
|
...typeof enableReact === "object" && enableReact,
|
|
12864
|
-
react: true,
|
|
12865
12829
|
reactRefresh: typeof enableReact === "object" && enableReact.reactRefresh !== void 0 ? enableReact.reactRefresh : normalizedOptions.reactRefresh !== false
|
|
12866
12830
|
}));
|
|
12867
12831
|
if (enablePrettier) configs.push(prettier());
|
|
@@ -12914,4 +12878,4 @@ async function defineConfig(options = {}, ...userConfigs) {
|
|
|
12914
12878
|
return jsse(options, ...userConfigs);
|
|
12915
12879
|
}
|
|
12916
12880
|
//#endregion
|
|
12917
|
-
export { VERSION, jsse as default, jsse, defaultOptions, defineConfig, globs_exports as globs };
|
|
12881
|
+
export { FIXABLE_RULES_MAP, VERSION, jsse as default, jsse, defaultOptions, defineConfig, globs_exports as globs };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/cli.ts","../src/config-registry.test.ts","../src/config-registry.ts","../src/const.ts","../src/define-config.ts","../src/fixable.test.ts","../src/fixable.ts","../src/globs.ts","../src/index.ts","../src/lager.ts","../src/options.test.ts","../src/options.ts","../src/plugin-registry.test.ts","../src/plugin-registry.ts","../src/plugins.ts","../src/postprocess.test.ts","../src/postprocess.ts","../src/types.ts","../src/utils.ts","../src/_generated/fixable-rules-map.ts","../src/_generated/rule-options.d.ts","../src/_generated/version.ts","../src/_generated/dts/antfu.d.ts","../src/_generated/dts/builtins.d.ts","../src/_generated/dts/command.d.ts","../src/_generated/dts/de-morgan.d.ts","../src/_generated/dts/e18e.d.ts","../src/_generated/dts/eslint-comments.d.ts","../src/_generated/dts/eslint-react.d.ts","../src/_generated/dts/ignores.d.ts","../src/_generated/dts/imports.d.ts","../src/_generated/dts/javascript.d.ts","../src/_generated/dts/jsdoc.d.ts","../src/_generated/dts/jsonc.d.ts","../src/_generated/dts/markdown.d.ts","../src/_generated/dts/n.d.ts","../src/_generated/dts/no-only-tests.d.ts","../src/_generated/dts/perfectionist.d.ts","../src/_generated/dts/pnpm.d.ts","../src/_generated/dts/prettier.d.ts","../src/_generated/dts/react-hooks.d.ts","../src/_generated/dts/regexp.d.ts","../src/_generated/dts/sort-package-json.d.ts","../src/_generated/dts/sort-tsconfig.d.ts","../src/_generated/dts/stylistic.d.ts","../src/_generated/dts/toml.d.ts","../src/_generated/dts/typescript.d.ts","../src/_generated/dts/unicorn.d.ts","../src/_generated/dts/vitest.d.ts","../src/_generated/dts/yml.d.ts","../src/configs/_template.ts","../src/configs/antfu.ts","../src/configs/command.ts","../src/configs/de-morgan.ts","../src/configs/disables.ts","../src/configs/e18e.ts","../src/configs/eslint-comments.ts","../src/configs/eslint-react.ts","../src/configs/ignores.ts","../src/configs/imports.ts","../src/configs/javascript.ts","../src/configs/jsdoc.ts","../src/configs/jsonc.ts","../src/configs/markdown.ts","../src/configs/n.ts","../src/configs/no-only-tests.ts","../src/configs/perfectionist.ts","../src/configs/pnpm.ts","../src/configs/prettier.ts","../src/configs/react-hooks.ts","../src/configs/
|
|
1
|
+
{"root":["../src/cli.ts","../src/config-registry.test.ts","../src/config-registry.ts","../src/const.ts","../src/define-config.ts","../src/fixable.test.ts","../src/fixable.ts","../src/globs.ts","../src/index.ts","../src/lager.ts","../src/options.test.ts","../src/options.ts","../src/plugin-registry.test.ts","../src/plugin-registry.ts","../src/plugins.ts","../src/postprocess.test.ts","../src/postprocess.ts","../src/types.ts","../src/utils.ts","../src/_generated/fixable-rules-map.ts","../src/_generated/rule-options.d.ts","../src/_generated/version.ts","../src/_generated/dts/antfu.d.ts","../src/_generated/dts/builtins.d.ts","../src/_generated/dts/command.d.ts","../src/_generated/dts/de-morgan.d.ts","../src/_generated/dts/e18e.d.ts","../src/_generated/dts/eslint-comments.d.ts","../src/_generated/dts/eslint-react.d.ts","../src/_generated/dts/ignores.d.ts","../src/_generated/dts/imports.d.ts","../src/_generated/dts/javascript.d.ts","../src/_generated/dts/jsdoc.d.ts","../src/_generated/dts/jsonc.d.ts","../src/_generated/dts/markdown.d.ts","../src/_generated/dts/n.d.ts","../src/_generated/dts/no-only-tests.d.ts","../src/_generated/dts/perfectionist.d.ts","../src/_generated/dts/pnpm.d.ts","../src/_generated/dts/prettier.d.ts","../src/_generated/dts/react-hooks.d.ts","../src/_generated/dts/regexp.d.ts","../src/_generated/dts/sort-package-json.d.ts","../src/_generated/dts/sort-tsconfig.d.ts","../src/_generated/dts/stylistic.d.ts","../src/_generated/dts/toml.d.ts","../src/_generated/dts/typescript.d.ts","../src/_generated/dts/unicorn.d.ts","../src/_generated/dts/vitest.d.ts","../src/_generated/dts/yml.d.ts","../src/configs/_template.ts","../src/configs/antfu.ts","../src/configs/command.ts","../src/configs/de-morgan.ts","../src/configs/disables.ts","../src/configs/e18e.ts","../src/configs/eslint-comments.ts","../src/configs/eslint-react.ts","../src/configs/ignores.ts","../src/configs/imports.ts","../src/configs/javascript.ts","../src/configs/jsdoc.ts","../src/configs/jsonc.ts","../src/configs/markdown.ts","../src/configs/n.ts","../src/configs/no-only-tests.ts","../src/configs/perfectionist.ts","../src/configs/pnpm.ts","../src/configs/prettier.ts","../src/configs/react-hooks.ts","../src/configs/regexp.ts","../src/configs/rules.test.ts","../src/configs/sort-geojson.ts","../src/configs/sort-package-json.ts","../src/configs/sort-tsconfig.ts","../src/configs/stylistic.ts","../src/configs/toml.ts","../src/configs/tsdoc.ts","../src/configs/unicorn.ts","../src/configs/vitest.ts","../src/configs/yml.ts","../src/configs/ts/parser.ts","../src/configs/ts/requires-type-checking.ts","../src/configs/ts/typescript-rules.ts","../src/configs/ts/typescript.ts"],"version":"6.0.3"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsse/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.9.0",
|
|
5
5
|
"description": "@jsse/eslint-config ~ WYSIWYG",
|
|
6
6
|
"author": "jessekrubin <jessekrubin@gmail.com> (https://github.com/jessekrubin/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -19,6 +19,10 @@
|
|
|
19
19
|
"types": "./dist/index.d.ts",
|
|
20
20
|
"import": "./dist/index.js"
|
|
21
21
|
},
|
|
22
|
+
"./fixable": {
|
|
23
|
+
"types": "./dist/fixable.d.ts",
|
|
24
|
+
"import": "./dist/fixable.js"
|
|
25
|
+
},
|
|
22
26
|
"./package.json": "./package.json"
|
|
23
27
|
},
|
|
24
28
|
"main": "./dist/index.js",
|
|
@@ -36,7 +40,6 @@
|
|
|
36
40
|
"peerDependencies": {
|
|
37
41
|
"@eslint-react/eslint-plugin": "^5.6.0",
|
|
38
42
|
"eslint": "^10.5.0",
|
|
39
|
-
"eslint-plugin-react": "^7.37.5",
|
|
40
43
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
41
44
|
"eslint-plugin-react-refresh": "^0.5.0"
|
|
42
45
|
},
|
|
@@ -47,9 +50,6 @@
|
|
|
47
50
|
"eslint": {
|
|
48
51
|
"optional": false
|
|
49
52
|
},
|
|
50
|
-
"eslint-plugin-react": {
|
|
51
|
-
"optional": true
|
|
52
|
-
},
|
|
53
53
|
"eslint-plugin-react-hooks": {
|
|
54
54
|
"optional": true
|
|
55
55
|
},
|
|
@@ -105,7 +105,6 @@
|
|
|
105
105
|
"@vitest/eslint-plugin": "^1.6.20",
|
|
106
106
|
"eslint": "^10.6.0",
|
|
107
107
|
"eslint-flat-config-utils": "^3.2.0",
|
|
108
|
-
"eslint-plugin-react": "^7.37.5",
|
|
109
108
|
"eslint-typegen": "^2.3.1",
|
|
110
109
|
"execa": "~9.6.1",
|
|
111
110
|
"fast-equals": "^6.0.0",
|
|
@@ -124,14 +123,29 @@
|
|
|
124
123
|
"tsdown": "^0.22.3",
|
|
125
124
|
"tsx": "^4.22.5",
|
|
126
125
|
"typescript": "~6.0.3",
|
|
127
|
-
"vitest": "^4.1.9"
|
|
126
|
+
"vitest": "^4.1.9",
|
|
127
|
+
"wireit": "^0.14.13"
|
|
128
128
|
},
|
|
129
129
|
"prettier": "@jsse/prettier-config",
|
|
130
|
+
"wireit": {
|
|
131
|
+
"gen": {
|
|
132
|
+
"command": "tsx scripts/gen.ts && prettier -w --cache --object-wrap=collapse src/_generated",
|
|
133
|
+
"files": [
|
|
134
|
+
"scripts/gen.ts",
|
|
135
|
+
"src/**/*.ts",
|
|
136
|
+
"!src/_generated/**",
|
|
137
|
+
"package.json"
|
|
138
|
+
],
|
|
139
|
+
"output": [
|
|
140
|
+
"src/_generated/**"
|
|
141
|
+
]
|
|
142
|
+
}
|
|
143
|
+
},
|
|
130
144
|
"scripts": {
|
|
131
145
|
"build": "pnpm gen && pnpm build-fast --dts && pnpm build:tsc && eslint .",
|
|
132
146
|
"build:tsc": "tsc -b tsconfig.build.json",
|
|
133
147
|
"build-fast": "tsdown --clean",
|
|
134
|
-
"gen": "
|
|
148
|
+
"gen": "wireit",
|
|
135
149
|
"dev": "tsdown src/index.ts --format esm --watch",
|
|
136
150
|
"fmt": "prettier -w --object-wrap=collapse .",
|
|
137
151
|
"fmtc": "prettier --check --object-wrap=collapse .",
|