@jsse/eslint-config 0.0.7 → 0.0.9

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
@@ -616,7 +616,7 @@ var CAC = class extends import_events.EventEmitter {
616
616
  var cac = (name = "") => new CAC(name);
617
617
 
618
618
  // package.json
619
- var version = "0.0.7";
619
+ var version = "0.0.9";
620
620
 
621
621
  // src/cli.ts
622
622
  var cli = cac("jsselint");
package/dist/cli.js CHANGED
@@ -592,7 +592,7 @@ var CAC = class extends EventEmitter {
592
592
  var cac = (name = "") => new CAC(name);
593
593
 
594
594
  // package.json
595
- var version = "0.0.7";
595
+ var version = "0.0.9";
596
596
 
597
597
  // src/cli.ts
598
598
  var cli = cac("jsselint");
package/dist/index.cjs CHANGED
@@ -2727,7 +2727,6 @@ function javascript(options = {}) {
2727
2727
  "no-useless-rename": "error",
2728
2728
  "no-useless-return": "error",
2729
2729
  "no-var": "error",
2730
- "no-void": "error",
2731
2730
  "no-with": "error",
2732
2731
  "object-shorthand": [
2733
2732
  "error",
@@ -3058,42 +3057,26 @@ function prettier() {
3058
3057
 
3059
3058
  // src/configs/ts/typescript-language-options.ts
3060
3059
  var import_node_process = __toESM(require("process"), 1);
3061
- function parserOptionProject(tsconfigPath) {
3062
- if (typeof tsconfigPath === "string") {
3063
- return [tsconfigPath];
3064
- }
3065
- return tsconfigPath;
3066
- }
3067
3060
  function typescriptLanguageOptions(options) {
3068
- const { parserOptions = {}, tsconfig, react: react2 } = options ?? {};
3069
- if (react2) {
3070
- return {
3071
- parser: parserTs,
3072
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
3073
- parserOptions: {
3074
- ecmaFeatures: { jsx: true, modules: true },
3075
- jsxPragma: null,
3076
- sourceType: "module",
3077
- ...tsconfig ? {
3078
- project: parserOptionProject(tsconfig),
3079
- tsconfigRootDir: import_node_process.default.cwd()
3080
- } : {},
3081
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3082
- ...parserOptions
3083
- }
3084
- };
3085
- }
3061
+ const {
3062
+ parserOptions = {},
3063
+ tsconfig,
3064
+ react: react2,
3065
+ componentExts = []
3066
+ } = options || {};
3067
+ const tsOptions = tsconfig ? {
3068
+ project: Array.isArray(tsconfig) ? tsconfig : [tsconfig],
3069
+ tsconfigRootDir: import_node_process.default.cwd()
3070
+ } : {};
3086
3071
  return {
3087
3072
  parser: parserTs,
3088
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
3089
3073
  parserOptions: {
3074
+ ecmaFeatures: react2 ? { jsx: true, modules: true } : void 0,
3075
+ extraFileExtensions: componentExts.map((ext) => `.${ext}`),
3090
3076
  sourceType: "module",
3091
- ...tsconfig ? {
3092
- project: parserOptionProject(tsconfig),
3093
- tsconfigRootDir: import_node_process.default.cwd()
3094
- } : {},
3095
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3096
- ...parserOptions
3077
+ ...tsOptions,
3078
+ ...parserOptions,
3079
+ jsxPragma: react2 ? "React" : void 0
3097
3080
  }
3098
3081
  };
3099
3082
  }
@@ -3330,11 +3313,18 @@ function reactRecomendedRules() {
3330
3313
  };
3331
3314
  }
3332
3315
  function react(options) {
3333
- const { parserOptions = {}, tsconfig, react: react2, reactRefresh } = options ?? {};
3316
+ const {
3317
+ parserOptions = {},
3318
+ tsconfig,
3319
+ react: react2,
3320
+ reactRefresh,
3321
+ componentExts
3322
+ } = options ?? {};
3334
3323
  const config = [
3335
3324
  {
3336
3325
  files: [GLOB_SRC],
3337
3326
  languageOptions: typescriptLanguageOptions({
3327
+ componentExts,
3338
3328
  parserOptions,
3339
3329
  react: react2,
3340
3330
  tsconfig
@@ -3614,31 +3604,23 @@ function test(options = {}) {
3614
3604
  {
3615
3605
  name: "jsse:test:setup",
3616
3606
  plugins: {
3617
- test: {
3618
- ...import_eslint_plugin_vitest.default,
3619
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
3620
- rules: {
3621
- ...import_eslint_plugin_vitest.default.rules,
3622
- // extend `test/no-only-tests` rule
3623
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
3624
- ...import_eslint_plugin_no_only_tests.default.rules
3625
- }
3626
- }
3607
+ "no-only-tests": import_eslint_plugin_no_only_tests.default,
3608
+ vitest: import_eslint_plugin_vitest.default
3627
3609
  }
3628
3610
  },
3629
3611
  {
3630
3612
  files: GLOB_TESTS,
3631
3613
  name: "jsse:test:rules",
3632
3614
  rules: {
3633
- "test/consistent-test-it": [
3615
+ "no-only-tests/no-only-tests": isInEditor2 ? "off" : isCI() ? "error" : "warn",
3616
+ "unicorn/no-null": "off",
3617
+ "vitest/consistent-test-it": [
3634
3618
  "error",
3635
- { fn: "it", withinDescribe: "it" }
3619
+ { fn: "test", withinDescribe: "test" }
3636
3620
  ],
3637
- "test/no-identical-title": "error",
3638
- "test/no-only-tests": isInEditor2 ? "off" : isCI() ? "error" : "warn",
3639
- "test/prefer-hooks-in-order": "error",
3640
- "test/prefer-lowercase-title": "error",
3641
- "unicorn/no-null": "off",
3621
+ "vitest/no-identical-title": "error",
3622
+ "vitest/prefer-hooks-in-order": "error",
3623
+ "vitest/prefer-lowercase-title": "error",
3642
3624
  ...overrides
3643
3625
  }
3644
3626
  }
package/dist/index.js CHANGED
@@ -2651,7 +2651,6 @@ function javascript(options = {}) {
2651
2651
  "no-useless-rename": "error",
2652
2652
  "no-useless-return": "error",
2653
2653
  "no-var": "error",
2654
- "no-void": "error",
2655
2654
  "no-with": "error",
2656
2655
  "object-shorthand": [
2657
2656
  "error",
@@ -2982,42 +2981,26 @@ function prettier() {
2982
2981
 
2983
2982
  // src/configs/ts/typescript-language-options.ts
2984
2983
  import process2 from "process";
2985
- function parserOptionProject(tsconfigPath) {
2986
- if (typeof tsconfigPath === "string") {
2987
- return [tsconfigPath];
2988
- }
2989
- return tsconfigPath;
2990
- }
2991
2984
  function typescriptLanguageOptions(options) {
2992
- const { parserOptions = {}, tsconfig, react: react2 } = options ?? {};
2993
- if (react2) {
2994
- return {
2995
- parser: parserTs,
2996
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
2997
- parserOptions: {
2998
- ecmaFeatures: { jsx: true, modules: true },
2999
- jsxPragma: null,
3000
- sourceType: "module",
3001
- ...tsconfig ? {
3002
- project: parserOptionProject(tsconfig),
3003
- tsconfigRootDir: process2.cwd()
3004
- } : {},
3005
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3006
- ...parserOptions
3007
- }
3008
- };
3009
- }
2985
+ const {
2986
+ parserOptions = {},
2987
+ tsconfig,
2988
+ react: react2,
2989
+ componentExts = []
2990
+ } = options || {};
2991
+ const tsOptions = tsconfig ? {
2992
+ project: Array.isArray(tsconfig) ? tsconfig : [tsconfig],
2993
+ tsconfigRootDir: process2.cwd()
2994
+ } : {};
3010
2995
  return {
3011
2996
  parser: parserTs,
3012
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
3013
2997
  parserOptions: {
2998
+ ecmaFeatures: react2 ? { jsx: true, modules: true } : void 0,
2999
+ extraFileExtensions: componentExts.map((ext) => `.${ext}`),
3014
3000
  sourceType: "module",
3015
- ...tsconfig ? {
3016
- project: parserOptionProject(tsconfig),
3017
- tsconfigRootDir: process2.cwd()
3018
- } : {},
3019
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3020
- ...parserOptions
3001
+ ...tsOptions,
3002
+ ...parserOptions,
3003
+ jsxPragma: react2 ? "React" : void 0
3021
3004
  }
3022
3005
  };
3023
3006
  }
@@ -3254,11 +3237,18 @@ function reactRecomendedRules() {
3254
3237
  };
3255
3238
  }
3256
3239
  function react(options) {
3257
- const { parserOptions = {}, tsconfig, react: react2, reactRefresh } = options ?? {};
3240
+ const {
3241
+ parserOptions = {},
3242
+ tsconfig,
3243
+ react: react2,
3244
+ reactRefresh,
3245
+ componentExts
3246
+ } = options ?? {};
3258
3247
  const config = [
3259
3248
  {
3260
3249
  files: [GLOB_SRC],
3261
3250
  languageOptions: typescriptLanguageOptions({
3251
+ componentExts,
3262
3252
  parserOptions,
3263
3253
  react: react2,
3264
3254
  tsconfig
@@ -3538,31 +3528,23 @@ function test(options = {}) {
3538
3528
  {
3539
3529
  name: "jsse:test:setup",
3540
3530
  plugins: {
3541
- test: {
3542
- ...default13,
3543
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
3544
- rules: {
3545
- ...default13.rules,
3546
- // extend `test/no-only-tests` rule
3547
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
3548
- ...default7.rules
3549
- }
3550
- }
3531
+ "no-only-tests": default7,
3532
+ vitest: default13
3551
3533
  }
3552
3534
  },
3553
3535
  {
3554
3536
  files: GLOB_TESTS,
3555
3537
  name: "jsse:test:rules",
3556
3538
  rules: {
3557
- "test/consistent-test-it": [
3539
+ "no-only-tests/no-only-tests": isInEditor2 ? "off" : isCI() ? "error" : "warn",
3540
+ "unicorn/no-null": "off",
3541
+ "vitest/consistent-test-it": [
3558
3542
  "error",
3559
- { fn: "it", withinDescribe: "it" }
3543
+ { fn: "test", withinDescribe: "test" }
3560
3544
  ],
3561
- "test/no-identical-title": "error",
3562
- "test/no-only-tests": isInEditor2 ? "off" : isCI() ? "error" : "warn",
3563
- "test/prefer-hooks-in-order": "error",
3564
- "test/prefer-lowercase-title": "error",
3565
- "unicorn/no-null": "off",
3545
+ "vitest/no-identical-title": "error",
3546
+ "vitest/prefer-hooks-in-order": "error",
3547
+ "vitest/prefer-lowercase-title": "error",
3566
3548
  ...overrides
3567
3549
  }
3568
3550
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jsse/eslint-config",
3
3
  "type": "module",
4
- "version": "0.0.7",
4
+ "version": "0.0.9",
5
5
  "packageManager": "pnpm@8.8.0",
6
6
  "description": "jsse eslint config",
7
7
  "author": "jessekrubin <jessekrubin@gmail.com> (https://github.com/jessekrubin/)",
@@ -89,7 +89,7 @@
89
89
  "vitest": "^0.34.6"
90
90
  },
91
91
  "scripts": {
92
- "build": "pnpm typecheck && pnpm build-fast --dts",
92
+ "build": "pnpm typecheck && pnpm fmtc && pnpm build-fast --dts && eslint .",
93
93
  "build-fast": "tsup src/index.ts src/cli.ts --format esm,cjs --clean",
94
94
  "dev": "tsup src/index.ts --format esm,cjs --watch & eslint-flat-config-viewer",
95
95
  "fmt": "prettier -w .",