@jsse/eslint-config 0.2.1 → 0.2.3
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/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.cjs +42 -17
- package/dist/index.d.cts +25 -2
- package/dist/index.d.ts +25 -2
- package/dist/index.js +42 -17
- package/package.json +6 -8
package/dist/cli.cjs
CHANGED
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -9891,15 +9891,18 @@ var Lager = class {
|
|
|
9891
9891
|
_level = "info";
|
|
9892
9892
|
id = "lager";
|
|
9893
9893
|
levelNo = levels[this._level];
|
|
9894
|
+
prefix = "";
|
|
9894
9895
|
constructor(options) {
|
|
9895
|
-
const { level, id } = {
|
|
9896
|
+
const { level, id, prefix } = {
|
|
9896
9897
|
level: "info",
|
|
9897
9898
|
id: "lager",
|
|
9899
|
+
prefix: "@jsse/eslint-config",
|
|
9898
9900
|
...options
|
|
9899
9901
|
};
|
|
9900
9902
|
this.id = id;
|
|
9901
9903
|
this._level = isLagerLevel(level) ? level : "info";
|
|
9902
9904
|
this.levelNo = levels[this._level];
|
|
9905
|
+
this.prefix = prefix;
|
|
9903
9906
|
this.log = this.log.bind(this);
|
|
9904
9907
|
this.debug = this.debug.bind(this);
|
|
9905
9908
|
}
|
|
@@ -9933,7 +9936,7 @@ var Lager = class {
|
|
|
9933
9936
|
if (this.levelNo > levels.info) {
|
|
9934
9937
|
return;
|
|
9935
9938
|
}
|
|
9936
|
-
console.info(...args);
|
|
9939
|
+
console.info("[@jsse/eslint-config]", ...args);
|
|
9937
9940
|
}
|
|
9938
9941
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9939
9942
|
warn(...args) {
|
|
@@ -11333,16 +11336,7 @@ var import_node_process4 = __toESM(require("process"), 1);
|
|
|
11333
11336
|
function typescriptLanguageOptions(options) {
|
|
11334
11337
|
const { componentExts = [], react: react2, tsconfig } = options || {};
|
|
11335
11338
|
const tsOptions = tsconfig ? {
|
|
11336
|
-
|
|
11337
|
-
projectService: {
|
|
11338
|
-
allowDefaultProject: [
|
|
11339
|
-
"*.js",
|
|
11340
|
-
"tsconfig.json",
|
|
11341
|
-
"*.ts",
|
|
11342
|
-
"scripts/*.ts"
|
|
11343
|
-
],
|
|
11344
|
-
defaultProject: tsconfig
|
|
11345
|
-
},
|
|
11339
|
+
project: Array.isArray(tsconfig) ? tsconfig : [tsconfig],
|
|
11346
11340
|
tsconfigRootDir: import_node_process4.default.cwd()
|
|
11347
11341
|
} : {};
|
|
11348
11342
|
const parserOptions = {
|
|
@@ -11927,6 +11921,12 @@ var tailwind = async (options) => {
|
|
|
11927
11921
|
|
|
11928
11922
|
// src/configs/ts/parser.ts
|
|
11929
11923
|
var import_node_process5 = __toESM(require("process"), 1);
|
|
11924
|
+
function autoUseParserService(options) {
|
|
11925
|
+
if (options.useProjectService !== void 0) {
|
|
11926
|
+
return options.useProjectService;
|
|
11927
|
+
}
|
|
11928
|
+
return !!(options.tsconfig && (typeof options.tsconfig === "string" && options.tsconfig === "tsconfig.json" || Array.isArray(options.tsconfig) && options.tsconfig.length === 1 && options.tsconfig[0] === "tsconfig.json"));
|
|
11929
|
+
}
|
|
11930
11930
|
function typescriptParser(options) {
|
|
11931
11931
|
const {
|
|
11932
11932
|
componentExts = [],
|
|
@@ -11934,9 +11934,34 @@ function typescriptParser(options) {
|
|
|
11934
11934
|
ignoresTypeAware: ignores2 = [GLOB_MARKDOWN],
|
|
11935
11935
|
parserOptions: parserOptionsOverride = {},
|
|
11936
11936
|
react: react2,
|
|
11937
|
-
tsconfig
|
|
11937
|
+
tsconfig,
|
|
11938
|
+
useProjectService = autoUseParserService(options)
|
|
11938
11939
|
} = options;
|
|
11939
11940
|
const typeAware = !!tsconfig;
|
|
11941
|
+
if (useProjectService) {
|
|
11942
|
+
return {
|
|
11943
|
+
files,
|
|
11944
|
+
...ignores2 ? { ignores: ignores2 } : {},
|
|
11945
|
+
languageOptions: {
|
|
11946
|
+
parser: parserTs,
|
|
11947
|
+
parserOptions: {
|
|
11948
|
+
extraFileExtensions: componentExts.map((ext) => `.${ext}`),
|
|
11949
|
+
jsxPragma: react2 ? "React" : void 0,
|
|
11950
|
+
sourceType: "module",
|
|
11951
|
+
...typeAware ? {
|
|
11952
|
+
projectService: {
|
|
11953
|
+
allowDefaultProject: ["*.js"],
|
|
11954
|
+
defaultProject: tsconfig
|
|
11955
|
+
},
|
|
11956
|
+
tsconfigRootDir: import_node_process5.default.cwd().replaceAll("\\", "/")
|
|
11957
|
+
} : {},
|
|
11958
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11959
|
+
...parserOptionsOverride
|
|
11960
|
+
}
|
|
11961
|
+
},
|
|
11962
|
+
name: `jsse/typescript/${typeAware ? "type-aware-parser" : "parser"}`
|
|
11963
|
+
};
|
|
11964
|
+
}
|
|
11940
11965
|
return {
|
|
11941
11966
|
files,
|
|
11942
11967
|
...ignores2 ? { ignores: ignores2 } : {},
|
|
@@ -11947,10 +11972,7 @@ function typescriptParser(options) {
|
|
|
11947
11972
|
jsxPragma: react2 ? "React" : void 0,
|
|
11948
11973
|
sourceType: "module",
|
|
11949
11974
|
...typeAware ? {
|
|
11950
|
-
|
|
11951
|
-
allowDefaultProject: ["*.js"],
|
|
11952
|
-
defaultProject: tsconfig
|
|
11953
|
-
},
|
|
11975
|
+
project: Array.isArray(tsconfig) ? tsconfig : [tsconfig],
|
|
11954
11976
|
tsconfigRootDir: import_node_process5.default.cwd().replaceAll("\\", "/")
|
|
11955
11977
|
} : {},
|
|
11956
11978
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -12487,6 +12509,9 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
12487
12509
|
log.error("Tailwind config failed", e);
|
|
12488
12510
|
}
|
|
12489
12511
|
}
|
|
12512
|
+
if (normalizedOptions.prettier) {
|
|
12513
|
+
configs.push(prettier());
|
|
12514
|
+
}
|
|
12490
12515
|
const fusedConfig = flatConfigProps.reduce((acc, key) => {
|
|
12491
12516
|
if (key in options) {
|
|
12492
12517
|
acc[key] = options[key];
|
package/dist/index.d.cts
CHANGED
|
@@ -5017,7 +5017,7 @@ interface JsdocRuleOptions {
|
|
|
5017
5017
|
"jsdoc/check-tag-names"?: Linter.RuleEntry<JsdocCheckTagNames>;
|
|
5018
5018
|
/**
|
|
5019
5019
|
* Checks that any `@template` names are actually used in the connected `@typedef` or type alias.
|
|
5020
|
-
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/
|
|
5020
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-template-names.md#repos-sticky-header
|
|
5021
5021
|
*/
|
|
5022
5022
|
"jsdoc/check-template-names"?: Linter.RuleEntry<[]>;
|
|
5023
5023
|
/**
|
|
@@ -5055,6 +5055,11 @@ interface JsdocRuleOptions {
|
|
|
5055
5055
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/informative-docs.md#repos-sticky-header
|
|
5056
5056
|
*/
|
|
5057
5057
|
"jsdoc/informative-docs"?: Linter.RuleEntry<JsdocInformativeDocs>;
|
|
5058
|
+
/**
|
|
5059
|
+
* Enforces minimum number of newlines before JSDoc comment blocks
|
|
5060
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/lines-before-block.md#repos-sticky-header
|
|
5061
|
+
*/
|
|
5062
|
+
"jsdoc/lines-before-block"?: Linter.RuleEntry<JsdocLinesBeforeBlock>;
|
|
5058
5063
|
/**
|
|
5059
5064
|
* Enforces a regular expression pattern on descriptions.
|
|
5060
5065
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/match-description.md#repos-sticky-header
|
|
@@ -5429,6 +5434,16 @@ type JsdocInformativeDocs =
|
|
|
5429
5434
|
uselessWords?: string[];
|
|
5430
5435
|
},
|
|
5431
5436
|
];
|
|
5437
|
+
// ----- jsdoc/lines-before-block -----
|
|
5438
|
+
type JsdocLinesBeforeBlock =
|
|
5439
|
+
| []
|
|
5440
|
+
| [
|
|
5441
|
+
{
|
|
5442
|
+
excludedTags?: string[];
|
|
5443
|
+
ignoreSameLine?: boolean;
|
|
5444
|
+
lines?: number;
|
|
5445
|
+
},
|
|
5446
|
+
];
|
|
5432
5447
|
// ----- jsdoc/match-description -----
|
|
5433
5448
|
type JsdocMatchDescription =
|
|
5434
5449
|
| []
|
|
@@ -20597,6 +20612,13 @@ type OptionsTypeScriptParserOptions = {
|
|
|
20597
20612
|
* Additional parser options for TypeScript.
|
|
20598
20613
|
*/
|
|
20599
20614
|
parserOptions?: Partial<ParserOptions>;
|
|
20615
|
+
/**
|
|
20616
|
+
* Flag to use `projectService` for type-aware linting (default: `false`).
|
|
20617
|
+
*
|
|
20618
|
+
* If `true` use fancy new `projectService` for type-aware linting
|
|
20619
|
+
* If `false` use classic `project` configuration
|
|
20620
|
+
*/
|
|
20621
|
+
useProjectService?: boolean;
|
|
20600
20622
|
/**
|
|
20601
20623
|
* Glob patterns for files that should be type aware.
|
|
20602
20624
|
* @default ['**\/*.{ts,tsx}']
|
|
@@ -20616,6 +20638,7 @@ type OptionsTypeScriptWithTypes = {
|
|
|
20616
20638
|
tsconfig?: string | string[];
|
|
20617
20639
|
typeAware?: boolean;
|
|
20618
20640
|
};
|
|
20641
|
+
type OptionsTypescript = (OptionsTypeScriptWithTypes & OptionsOverrides) | (OptionsTypeScriptParserOptions & OptionsOverrides);
|
|
20619
20642
|
type OptionsHasTypeScript = {
|
|
20620
20643
|
typescript?: boolean;
|
|
20621
20644
|
};
|
|
@@ -21796,4 +21819,4 @@ declare function isInEditor(): boolean;
|
|
|
21796
21819
|
declare function jssestd(): Promise<TypedFlatConfigItem[]>;
|
|
21797
21820
|
declare function jsseReact(): Promise<TypedFlatConfigItem[]>;
|
|
21798
21821
|
|
|
21799
|
-
export { type Awaitable, type EslintConfigFn, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_JS_SRC_EXT, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_YAML, type LanguageOptions, type OptionsCommon, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsPrefix, type OptionsReact, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PromiseFlatConfigItem, type RenamePefix, type Rules, type StylisticConfig, type TailwindEslintSettings, type TailwindOptions, type TypedFlatConfigItem, combine, combineAsync, jsse as default, importJsoncLibs, importParserJsonc, importPluginJsdoc, importPluginJsonc, importPluginMarkdown, importPluginReact, importPluginReactHooks, importPluginReactRefresh, importPluginStylistic, importPluginTailwind, importPluginTsdoc, importReactPlugins, importYmlLibs, interopDefault, isCI, isInEditor, jsse, jsseReact, jssestd, renameRules };
|
|
21822
|
+
export { type Awaitable, type EslintConfigFn, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_JS_SRC_EXT, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_YAML, type LanguageOptions, type OptionsCommon, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsPrefix, type OptionsReact, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type PromiseFlatConfigItem, type RenamePefix, type Rules, type StylisticConfig, type TailwindEslintSettings, type TailwindOptions, type TypedFlatConfigItem, combine, combineAsync, jsse as default, importJsoncLibs, importParserJsonc, importPluginJsdoc, importPluginJsonc, importPluginMarkdown, importPluginReact, importPluginReactHooks, importPluginReactRefresh, importPluginStylistic, importPluginTailwind, importPluginTsdoc, importReactPlugins, importYmlLibs, interopDefault, isCI, isInEditor, jsse, jsseReact, jssestd, renameRules };
|
package/dist/index.d.ts
CHANGED
|
@@ -5017,7 +5017,7 @@ interface JsdocRuleOptions {
|
|
|
5017
5017
|
"jsdoc/check-tag-names"?: Linter.RuleEntry<JsdocCheckTagNames>;
|
|
5018
5018
|
/**
|
|
5019
5019
|
* Checks that any `@template` names are actually used in the connected `@typedef` or type alias.
|
|
5020
|
-
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/
|
|
5020
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-template-names.md#repos-sticky-header
|
|
5021
5021
|
*/
|
|
5022
5022
|
"jsdoc/check-template-names"?: Linter.RuleEntry<[]>;
|
|
5023
5023
|
/**
|
|
@@ -5055,6 +5055,11 @@ interface JsdocRuleOptions {
|
|
|
5055
5055
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/informative-docs.md#repos-sticky-header
|
|
5056
5056
|
*/
|
|
5057
5057
|
"jsdoc/informative-docs"?: Linter.RuleEntry<JsdocInformativeDocs>;
|
|
5058
|
+
/**
|
|
5059
|
+
* Enforces minimum number of newlines before JSDoc comment blocks
|
|
5060
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/lines-before-block.md#repos-sticky-header
|
|
5061
|
+
*/
|
|
5062
|
+
"jsdoc/lines-before-block"?: Linter.RuleEntry<JsdocLinesBeforeBlock>;
|
|
5058
5063
|
/**
|
|
5059
5064
|
* Enforces a regular expression pattern on descriptions.
|
|
5060
5065
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/match-description.md#repos-sticky-header
|
|
@@ -5429,6 +5434,16 @@ type JsdocInformativeDocs =
|
|
|
5429
5434
|
uselessWords?: string[];
|
|
5430
5435
|
},
|
|
5431
5436
|
];
|
|
5437
|
+
// ----- jsdoc/lines-before-block -----
|
|
5438
|
+
type JsdocLinesBeforeBlock =
|
|
5439
|
+
| []
|
|
5440
|
+
| [
|
|
5441
|
+
{
|
|
5442
|
+
excludedTags?: string[];
|
|
5443
|
+
ignoreSameLine?: boolean;
|
|
5444
|
+
lines?: number;
|
|
5445
|
+
},
|
|
5446
|
+
];
|
|
5432
5447
|
// ----- jsdoc/match-description -----
|
|
5433
5448
|
type JsdocMatchDescription =
|
|
5434
5449
|
| []
|
|
@@ -20597,6 +20612,13 @@ type OptionsTypeScriptParserOptions = {
|
|
|
20597
20612
|
* Additional parser options for TypeScript.
|
|
20598
20613
|
*/
|
|
20599
20614
|
parserOptions?: Partial<ParserOptions>;
|
|
20615
|
+
/**
|
|
20616
|
+
* Flag to use `projectService` for type-aware linting (default: `false`).
|
|
20617
|
+
*
|
|
20618
|
+
* If `true` use fancy new `projectService` for type-aware linting
|
|
20619
|
+
* If `false` use classic `project` configuration
|
|
20620
|
+
*/
|
|
20621
|
+
useProjectService?: boolean;
|
|
20600
20622
|
/**
|
|
20601
20623
|
* Glob patterns for files that should be type aware.
|
|
20602
20624
|
* @default ['**\/*.{ts,tsx}']
|
|
@@ -20616,6 +20638,7 @@ type OptionsTypeScriptWithTypes = {
|
|
|
20616
20638
|
tsconfig?: string | string[];
|
|
20617
20639
|
typeAware?: boolean;
|
|
20618
20640
|
};
|
|
20641
|
+
type OptionsTypescript = (OptionsTypeScriptWithTypes & OptionsOverrides) | (OptionsTypeScriptParserOptions & OptionsOverrides);
|
|
20619
20642
|
type OptionsHasTypeScript = {
|
|
20620
20643
|
typescript?: boolean;
|
|
20621
20644
|
};
|
|
@@ -21796,4 +21819,4 @@ declare function isInEditor(): boolean;
|
|
|
21796
21819
|
declare function jssestd(): Promise<TypedFlatConfigItem[]>;
|
|
21797
21820
|
declare function jsseReact(): Promise<TypedFlatConfigItem[]>;
|
|
21798
21821
|
|
|
21799
|
-
export { type Awaitable, type EslintConfigFn, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_JS_SRC_EXT, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_YAML, type LanguageOptions, type OptionsCommon, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsPrefix, type OptionsReact, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type PromiseFlatConfigItem, type RenamePefix, type Rules, type StylisticConfig, type TailwindEslintSettings, type TailwindOptions, type TypedFlatConfigItem, combine, combineAsync, jsse as default, importJsoncLibs, importParserJsonc, importPluginJsdoc, importPluginJsonc, importPluginMarkdown, importPluginReact, importPluginReactHooks, importPluginReactRefresh, importPluginStylistic, importPluginTailwind, importPluginTsdoc, importReactPlugins, importYmlLibs, interopDefault, isCI, isInEditor, jsse, jsseReact, jssestd, renameRules };
|
|
21822
|
+
export { type Awaitable, type EslintConfigFn, GLOB_ALL_SRC, GLOB_CSS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_JS_SRC_EXT, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_YAML, type LanguageOptions, type OptionsCommon, type OptionsComponentExts, type OptionsConfig, type OptionsFiles, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsOverrides, type OptionsPrefix, type OptionsReact, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type PromiseFlatConfigItem, type RenamePefix, type Rules, type StylisticConfig, type TailwindEslintSettings, type TailwindOptions, type TypedFlatConfigItem, combine, combineAsync, jsse as default, importJsoncLibs, importParserJsonc, importPluginJsdoc, importPluginJsonc, importPluginMarkdown, importPluginReact, importPluginReactHooks, importPluginReactRefresh, importPluginStylistic, importPluginTailwind, importPluginTsdoc, importReactPlugins, importYmlLibs, interopDefault, isCI, isInEditor, jsse, jsseReact, jssestd, renameRules };
|
package/dist/index.js
CHANGED
|
@@ -9822,15 +9822,18 @@ var Lager = class {
|
|
|
9822
9822
|
_level = "info";
|
|
9823
9823
|
id = "lager";
|
|
9824
9824
|
levelNo = levels[this._level];
|
|
9825
|
+
prefix = "";
|
|
9825
9826
|
constructor(options) {
|
|
9826
|
-
const { level, id } = {
|
|
9827
|
+
const { level, id, prefix } = {
|
|
9827
9828
|
level: "info",
|
|
9828
9829
|
id: "lager",
|
|
9830
|
+
prefix: "@jsse/eslint-config",
|
|
9829
9831
|
...options
|
|
9830
9832
|
};
|
|
9831
9833
|
this.id = id;
|
|
9832
9834
|
this._level = isLagerLevel(level) ? level : "info";
|
|
9833
9835
|
this.levelNo = levels[this._level];
|
|
9836
|
+
this.prefix = prefix;
|
|
9834
9837
|
this.log = this.log.bind(this);
|
|
9835
9838
|
this.debug = this.debug.bind(this);
|
|
9836
9839
|
}
|
|
@@ -9864,7 +9867,7 @@ var Lager = class {
|
|
|
9864
9867
|
if (this.levelNo > levels.info) {
|
|
9865
9868
|
return;
|
|
9866
9869
|
}
|
|
9867
|
-
console.info(...args);
|
|
9870
|
+
console.info("[@jsse/eslint-config]", ...args);
|
|
9868
9871
|
}
|
|
9869
9872
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9870
9873
|
warn(...args) {
|
|
@@ -11264,16 +11267,7 @@ import process4 from "process";
|
|
|
11264
11267
|
function typescriptLanguageOptions(options) {
|
|
11265
11268
|
const { componentExts = [], react: react2, tsconfig } = options || {};
|
|
11266
11269
|
const tsOptions = tsconfig ? {
|
|
11267
|
-
|
|
11268
|
-
projectService: {
|
|
11269
|
-
allowDefaultProject: [
|
|
11270
|
-
"*.js",
|
|
11271
|
-
"tsconfig.json",
|
|
11272
|
-
"*.ts",
|
|
11273
|
-
"scripts/*.ts"
|
|
11274
|
-
],
|
|
11275
|
-
defaultProject: tsconfig
|
|
11276
|
-
},
|
|
11270
|
+
project: Array.isArray(tsconfig) ? tsconfig : [tsconfig],
|
|
11277
11271
|
tsconfigRootDir: process4.cwd()
|
|
11278
11272
|
} : {};
|
|
11279
11273
|
const parserOptions = {
|
|
@@ -11858,6 +11852,12 @@ var tailwind = async (options) => {
|
|
|
11858
11852
|
|
|
11859
11853
|
// src/configs/ts/parser.ts
|
|
11860
11854
|
import process5 from "process";
|
|
11855
|
+
function autoUseParserService(options) {
|
|
11856
|
+
if (options.useProjectService !== void 0) {
|
|
11857
|
+
return options.useProjectService;
|
|
11858
|
+
}
|
|
11859
|
+
return !!(options.tsconfig && (typeof options.tsconfig === "string" && options.tsconfig === "tsconfig.json" || Array.isArray(options.tsconfig) && options.tsconfig.length === 1 && options.tsconfig[0] === "tsconfig.json"));
|
|
11860
|
+
}
|
|
11861
11861
|
function typescriptParser(options) {
|
|
11862
11862
|
const {
|
|
11863
11863
|
componentExts = [],
|
|
@@ -11865,9 +11865,34 @@ function typescriptParser(options) {
|
|
|
11865
11865
|
ignoresTypeAware: ignores2 = [GLOB_MARKDOWN],
|
|
11866
11866
|
parserOptions: parserOptionsOverride = {},
|
|
11867
11867
|
react: react2,
|
|
11868
|
-
tsconfig
|
|
11868
|
+
tsconfig,
|
|
11869
|
+
useProjectService = autoUseParserService(options)
|
|
11869
11870
|
} = options;
|
|
11870
11871
|
const typeAware = !!tsconfig;
|
|
11872
|
+
if (useProjectService) {
|
|
11873
|
+
return {
|
|
11874
|
+
files,
|
|
11875
|
+
...ignores2 ? { ignores: ignores2 } : {},
|
|
11876
|
+
languageOptions: {
|
|
11877
|
+
parser: parserTs,
|
|
11878
|
+
parserOptions: {
|
|
11879
|
+
extraFileExtensions: componentExts.map((ext) => `.${ext}`),
|
|
11880
|
+
jsxPragma: react2 ? "React" : void 0,
|
|
11881
|
+
sourceType: "module",
|
|
11882
|
+
...typeAware ? {
|
|
11883
|
+
projectService: {
|
|
11884
|
+
allowDefaultProject: ["*.js"],
|
|
11885
|
+
defaultProject: tsconfig
|
|
11886
|
+
},
|
|
11887
|
+
tsconfigRootDir: process5.cwd().replaceAll("\\", "/")
|
|
11888
|
+
} : {},
|
|
11889
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11890
|
+
...parserOptionsOverride
|
|
11891
|
+
}
|
|
11892
|
+
},
|
|
11893
|
+
name: `jsse/typescript/${typeAware ? "type-aware-parser" : "parser"}`
|
|
11894
|
+
};
|
|
11895
|
+
}
|
|
11871
11896
|
return {
|
|
11872
11897
|
files,
|
|
11873
11898
|
...ignores2 ? { ignores: ignores2 } : {},
|
|
@@ -11878,10 +11903,7 @@ function typescriptParser(options) {
|
|
|
11878
11903
|
jsxPragma: react2 ? "React" : void 0,
|
|
11879
11904
|
sourceType: "module",
|
|
11880
11905
|
...typeAware ? {
|
|
11881
|
-
|
|
11882
|
-
allowDefaultProject: ["*.js"],
|
|
11883
|
-
defaultProject: tsconfig
|
|
11884
|
-
},
|
|
11906
|
+
project: Array.isArray(tsconfig) ? tsconfig : [tsconfig],
|
|
11885
11907
|
tsconfigRootDir: process5.cwd().replaceAll("\\", "/")
|
|
11886
11908
|
} : {},
|
|
11887
11909
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -12418,6 +12440,9 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
12418
12440
|
log.error("Tailwind config failed", e);
|
|
12419
12441
|
}
|
|
12420
12442
|
}
|
|
12443
|
+
if (normalizedOptions.prettier) {
|
|
12444
|
+
configs.push(prettier());
|
|
12445
|
+
}
|
|
12421
12446
|
const fusedConfig = flatConfigProps.reduce((acc, key) => {
|
|
12422
12447
|
if (key in options) {
|
|
12423
12448
|
acc[key] = options[key];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsse/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.3",
|
|
5
5
|
"description": "@jsse/eslint-config ~ WYSIWYG",
|
|
6
6
|
"author": "jessekrubin <jessekrubin@gmail.com> (https://github.com/jessekrubin/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"eslint-plugin-antfu": "^2.3.4",
|
|
68
68
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
69
69
|
"eslint-plugin-import-x": "^3.1.0",
|
|
70
|
-
"eslint-plugin-jsdoc": "^
|
|
70
|
+
"eslint-plugin-jsdoc": "^50.0.0",
|
|
71
71
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
72
72
|
"eslint-plugin-markdown": "^5.1.0",
|
|
73
73
|
"eslint-plugin-n": "^17.10.2",
|
|
@@ -83,16 +83,12 @@
|
|
|
83
83
|
"eslint-plugin-vitest": "0.5.4",
|
|
84
84
|
"eslint-plugin-yml": "^1.14.0",
|
|
85
85
|
"jsonc-eslint-parser": "^2.4.0",
|
|
86
|
+
"picocolors": "^1.0.1",
|
|
86
87
|
"toml-eslint-parser": "^0.10.0",
|
|
87
88
|
"typescript-eslint": "^8.0.1",
|
|
88
89
|
"yaml-eslint-parser": "^1.2.3"
|
|
89
90
|
},
|
|
90
|
-
"optionalDependencies": {
|
|
91
|
-
"eslint-plugin-tailwindcss": "^3.17.4",
|
|
92
|
-
"tailwindcss": "^3.4.7"
|
|
93
|
-
},
|
|
94
91
|
"devDependencies": {
|
|
95
|
-
"@antfu/ni": "^0.22.0",
|
|
96
92
|
"@biomejs/biome": "1.8.3",
|
|
97
93
|
"@changesets/cli": "^2.27.7",
|
|
98
94
|
"@jsse/prettier-config": "^0.1.0",
|
|
@@ -103,6 +99,7 @@
|
|
|
103
99
|
"cac": "^6.7.14",
|
|
104
100
|
"eslint": "^9.8.0",
|
|
105
101
|
"eslint-flat-config-utils": "^0.3.0",
|
|
102
|
+
"eslint-plugin-tailwindcss": "^3.17.4",
|
|
106
103
|
"eslint-typegen": "^0.3.0",
|
|
107
104
|
"execa": "~9.3.0",
|
|
108
105
|
"fast-glob": "^3.3.2",
|
|
@@ -112,6 +109,7 @@
|
|
|
112
109
|
"prettier": "^3.3.3",
|
|
113
110
|
"react": "~18.3.1",
|
|
114
111
|
"rimraf": "^6.0.1",
|
|
112
|
+
"tailwindcss": "^3.4.9",
|
|
115
113
|
"tsup": "^8.2.4",
|
|
116
114
|
"tsx": "^4.16.5",
|
|
117
115
|
"typescript": "~5.5.4",
|
|
@@ -123,7 +121,7 @@
|
|
|
123
121
|
"build-fast": "tsup src/index.ts src/cli.ts --format esm,cjs --clean",
|
|
124
122
|
"gen": "tsx scripts/gen.ts && prettier -w src",
|
|
125
123
|
"dev": "tsup src/index.ts --format esm,cjs --watch",
|
|
126
|
-
"fmt": "prettier -w .",
|
|
124
|
+
"fmt": "prettier -w --cache .",
|
|
127
125
|
"fmtc": "prettier --check .",
|
|
128
126
|
"lint": "pnpm run build-fast && eslint .",
|
|
129
127
|
"change": "changeset",
|