@jsse/eslint-config 0.2.2 → 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 CHANGED
@@ -612,7 +612,7 @@ var CAC = class extends import_events.EventEmitter {
612
612
  var cac = (name = "") => new CAC(name);
613
613
 
614
614
  // package.json
615
- var version = "0.2.2";
615
+ var version = "0.2.3";
616
616
 
617
617
  // src/cli.ts
618
618
  var cli = cac("jsselint");
package/dist/cli.js CHANGED
@@ -588,7 +588,7 @@ var CAC = class extends EventEmitter {
588
588
  var cac = (name = "") => new CAC(name);
589
589
 
590
590
  // package.json
591
- var version = "0.2.2";
591
+ var version = "0.2.3";
592
592
 
593
593
  // src/cli.ts
594
594
  var cli = cac("jsselint");
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
- // project: Array.isArray(tsconfig) ? tsconfig : [tsconfig],
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
- projectService: {
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
@@ -20612,6 +20612,13 @@ type OptionsTypeScriptParserOptions = {
20612
20612
  * Additional parser options for TypeScript.
20613
20613
  */
20614
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;
20615
20622
  /**
20616
20623
  * Glob patterns for files that should be type aware.
20617
20624
  * @default ['**\/*.{ts,tsx}']
@@ -20631,6 +20638,7 @@ type OptionsTypeScriptWithTypes = {
20631
20638
  tsconfig?: string | string[];
20632
20639
  typeAware?: boolean;
20633
20640
  };
20641
+ type OptionsTypescript = (OptionsTypeScriptWithTypes & OptionsOverrides) | (OptionsTypeScriptParserOptions & OptionsOverrides);
20634
20642
  type OptionsHasTypeScript = {
20635
20643
  typescript?: boolean;
20636
20644
  };
@@ -21811,4 +21819,4 @@ declare function isInEditor(): boolean;
21811
21819
  declare function jssestd(): Promise<TypedFlatConfigItem[]>;
21812
21820
  declare function jsseReact(): Promise<TypedFlatConfigItem[]>;
21813
21821
 
21814
- 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
@@ -20612,6 +20612,13 @@ type OptionsTypeScriptParserOptions = {
20612
20612
  * Additional parser options for TypeScript.
20613
20613
  */
20614
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;
20615
20622
  /**
20616
20623
  * Glob patterns for files that should be type aware.
20617
20624
  * @default ['**\/*.{ts,tsx}']
@@ -20631,6 +20638,7 @@ type OptionsTypeScriptWithTypes = {
20631
20638
  tsconfig?: string | string[];
20632
20639
  typeAware?: boolean;
20633
20640
  };
20641
+ type OptionsTypescript = (OptionsTypeScriptWithTypes & OptionsOverrides) | (OptionsTypeScriptParserOptions & OptionsOverrides);
20634
20642
  type OptionsHasTypeScript = {
20635
20643
  typescript?: boolean;
20636
20644
  };
@@ -21811,4 +21819,4 @@ declare function isInEditor(): boolean;
21811
21819
  declare function jssestd(): Promise<TypedFlatConfigItem[]>;
21812
21820
  declare function jsseReact(): Promise<TypedFlatConfigItem[]>;
21813
21821
 
21814
- 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
- // project: Array.isArray(tsconfig) ? tsconfig : [tsconfig],
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
- projectService: {
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.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",
@@ -83,12 +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
91
  "devDependencies": {
91
- "@antfu/ni": "^0.22.0",
92
92
  "@biomejs/biome": "1.8.3",
93
93
  "@changesets/cli": "^2.27.7",
94
94
  "@jsse/prettier-config": "^0.1.0",
@@ -109,7 +109,7 @@
109
109
  "prettier": "^3.3.3",
110
110
  "react": "~18.3.1",
111
111
  "rimraf": "^6.0.1",
112
- "tailwindcss": "^3.4.7",
112
+ "tailwindcss": "^3.4.9",
113
113
  "tsup": "^8.2.4",
114
114
  "tsx": "^4.16.5",
115
115
  "typescript": "~5.5.4",
@@ -121,7 +121,7 @@
121
121
  "build-fast": "tsup src/index.ts src/cli.ts --format esm,cjs --clean",
122
122
  "gen": "tsx scripts/gen.ts && prettier -w src",
123
123
  "dev": "tsup src/index.ts --format esm,cjs --watch",
124
- "fmt": "prettier -w .",
124
+ "fmt": "prettier -w --cache .",
125
125
  "fmtc": "prettier --check .",
126
126
  "lint": "pnpm run build-fast && eslint .",
127
127
  "change": "changeset",