eslint-config-un 0.6.0 → 0.6.1

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 CHANGED
@@ -79,6 +79,7 @@ export default eslintConfig({
79
79
  - `packageJson`
80
80
  - `perfectionist`
81
81
  - `deMorgan`
82
+ - `jsonSchemaValidator`
82
83
  - Some rules are set to warn by default. You can change some or even all such rule's reporting level using `errorsInsteadOfWarnings` option. You can find all such rules by inspecting the source code of this package.
83
84
 
84
85
  ### Certain rules are disabled for code blocks inside `*.md` files
package/dist/index.cjs CHANGED
@@ -642,7 +642,7 @@ var maybeCall = (fnOrValue, ...args) => typeof fnOrValue === "function" ? fnOrVa
642
642
  // src/configs/import.ts
643
643
  var pluginRenamer = createPluginObjectRenamer("import-x", "import");
644
644
  var importEslintConfig = (options = {}, internalOptions = {}) => {
645
- const { isTypescriptEnabled, noDuplicatesOptions } = options;
645
+ const { isTypescriptEnabled, tsResolverOptions, noDuplicatesOptions } = options;
646
646
  const noUnresolvedIgnores = arraify(options.importPatternsToIgnoreWhenTryingToResolve);
647
647
  const builder = new ConfigEntryBuilder(options, internalOptions);
648
648
  builder.addConfig(["import", { includeDefaultFilesAndIgnores: true }], {
@@ -652,7 +652,10 @@ var importEslintConfig = (options = {}, internalOptions = {}) => {
652
652
  // If the TS resolver goes after the node resolver, `import/no-deprecated` doesn't work
653
653
  // TODO should report?
654
654
  isTypescriptEnabled && (0, import_eslint_import_resolver_typescript.createTypeScriptImportResolver)({
655
- alwaysTryTypes: true
655
+ alwaysTryTypes: true,
656
+ // Does not resolve paths in sub-directories with their own tsconfigs after 3.8.0 w/o explicit `project`: https://github.com/import-js/eslint-import-resolver-typescript/issues/364
657
+ project: "*/tsconfig*.json",
658
+ ...tsResolverOptions
656
659
  }),
657
660
  import_eslint_plugin_import_x.default.createNodeResolver()
658
661
  ].filter((v) => typeof v === "object"),
@@ -1792,7 +1795,6 @@ var vueEslintConfig = (options, internalOptions = {}) => {
1792
1795
  const inNuxtAppDir = joinPaths.bind(null, options.nuxtOrVueProjectDir);
1793
1796
  const nuxtLayoutsFilesGlob = inNuxtAppDir("layouts/**/*.vue");
1794
1797
  const builder = new ConfigEntryBuilder(options, internalOptions);
1795
- builder.addConfig(["vue/plugin", { doNotIgnoreMarkdown: true }]);
1796
1798
  builder.addConfig(["vue/setup", { doNotIgnoreMarkdown: true }], {
1797
1799
  files: [GLOB_VUE, ...files],
1798
1800
  processor: (0, import_eslint_merge_processors2.mergeProcessors)(
package/dist/index.d.cts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
2
2
  import Eslint, { Linter } from 'eslint';
3
+ import { TsResolverOptions } from 'eslint-import-resolver-typescript';
3
4
  import { Jest } from '@jest/environment';
4
5
  import { JestExpect, AsymmetricMatchers } from '@jest/expect';
5
6
  import { ValueOf } from 'type-fest';
@@ -22314,7 +22315,18 @@ type DisableAutofixNodeNoRestrictedRequire = []|[(string | {
22314
22315
  // ----- disable-autofix/node/no-sync -----
22315
22316
  type DisableAutofixNodeNoSync = []|[{
22316
22317
  allowAtRootLevel?: boolean
22317
- ignores?: string[]
22318
+ ignores?: (string | {
22319
+ from?: "file"
22320
+ path?: string
22321
+ name?: string[]
22322
+ } | {
22323
+ from?: "lib"
22324
+ name?: string[]
22325
+ } | {
22326
+ from?: "package"
22327
+ package?: string
22328
+ name?: string[]
22329
+ })[]
22318
22330
  }]
22319
22331
  // ----- disable-autofix/node/no-unpublished-bin -----
22320
22332
  type DisableAutofixNodeNoUnpublishedBin = []|[{
@@ -28863,7 +28875,18 @@ type NodeNoRestrictedRequire = []|[(string | {
28863
28875
  // ----- node/no-sync -----
28864
28876
  type NodeNoSync = []|[{
28865
28877
  allowAtRootLevel?: boolean
28866
- ignores?: string[]
28878
+ ignores?: (string | {
28879
+ from?: "file"
28880
+ path?: string
28881
+ name?: string[]
28882
+ } | {
28883
+ from?: "lib"
28884
+ name?: string[]
28885
+ } | {
28886
+ from?: "package"
28887
+ package?: string
28888
+ name?: string[]
28889
+ })[]
28867
28890
  }]
28868
28891
  // ----- node/no-unpublished-bin -----
28869
28892
  type NodeNoUnpublishedBin = []|[{
@@ -33536,9 +33559,17 @@ interface CliEslintConfigOptions extends ConfigSharedOptions {
33536
33559
 
33537
33560
  interface ImportEslintConfigOptions extends ConfigSharedOptions<'import'> {
33538
33561
  /**
33539
- * Recognized automatically and normally should not be set manually
33562
+ * Recognized automatically and normally should not be set manually.
33563
+ *
33564
+ * When enabled, creates a [`eslint-import-resolver-typescript`](https://www.npmjs.com/package/eslint-import-resolver-typescript) resolver with `alwaysTryTypes: true` and
33565
+ * `project: '* /tsconfig*.json'` options (with actually no space after the asterisk),
33566
+ * which can be overridden using `tsResolverOptions` option.
33540
33567
  */
33541
33568
  isTypescriptEnabled?: boolean;
33569
+ /**
33570
+ * Will be merged with the default TypeScript resolve options (see `isTypescriptEnabled` option docs for more info).
33571
+ */
33572
+ tsResolverOptions?: TsResolverOptions;
33542
33573
  /**
33543
33574
  * @see https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-unresolved.md#ignore
33544
33575
  */
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
2
2
  import Eslint, { Linter } from 'eslint';
3
+ import { TsResolverOptions } from 'eslint-import-resolver-typescript';
3
4
  import { Jest } from '@jest/environment';
4
5
  import { JestExpect, AsymmetricMatchers } from '@jest/expect';
5
6
  import { ValueOf } from 'type-fest';
@@ -22314,7 +22315,18 @@ type DisableAutofixNodeNoRestrictedRequire = []|[(string | {
22314
22315
  // ----- disable-autofix/node/no-sync -----
22315
22316
  type DisableAutofixNodeNoSync = []|[{
22316
22317
  allowAtRootLevel?: boolean
22317
- ignores?: string[]
22318
+ ignores?: (string | {
22319
+ from?: "file"
22320
+ path?: string
22321
+ name?: string[]
22322
+ } | {
22323
+ from?: "lib"
22324
+ name?: string[]
22325
+ } | {
22326
+ from?: "package"
22327
+ package?: string
22328
+ name?: string[]
22329
+ })[]
22318
22330
  }]
22319
22331
  // ----- disable-autofix/node/no-unpublished-bin -----
22320
22332
  type DisableAutofixNodeNoUnpublishedBin = []|[{
@@ -28863,7 +28875,18 @@ type NodeNoRestrictedRequire = []|[(string | {
28863
28875
  // ----- node/no-sync -----
28864
28876
  type NodeNoSync = []|[{
28865
28877
  allowAtRootLevel?: boolean
28866
- ignores?: string[]
28878
+ ignores?: (string | {
28879
+ from?: "file"
28880
+ path?: string
28881
+ name?: string[]
28882
+ } | {
28883
+ from?: "lib"
28884
+ name?: string[]
28885
+ } | {
28886
+ from?: "package"
28887
+ package?: string
28888
+ name?: string[]
28889
+ })[]
28867
28890
  }]
28868
28891
  // ----- node/no-unpublished-bin -----
28869
28892
  type NodeNoUnpublishedBin = []|[{
@@ -33536,9 +33559,17 @@ interface CliEslintConfigOptions extends ConfigSharedOptions {
33536
33559
 
33537
33560
  interface ImportEslintConfigOptions extends ConfigSharedOptions<'import'> {
33538
33561
  /**
33539
- * Recognized automatically and normally should not be set manually
33562
+ * Recognized automatically and normally should not be set manually.
33563
+ *
33564
+ * When enabled, creates a [`eslint-import-resolver-typescript`](https://www.npmjs.com/package/eslint-import-resolver-typescript) resolver with `alwaysTryTypes: true` and
33565
+ * `project: '* /tsconfig*.json'` options (with actually no space after the asterisk),
33566
+ * which can be overridden using `tsResolverOptions` option.
33540
33567
  */
33541
33568
  isTypescriptEnabled?: boolean;
33569
+ /**
33570
+ * Will be merged with the default TypeScript resolve options (see `isTypescriptEnabled` option docs for more info).
33571
+ */
33572
+ tsResolverOptions?: TsResolverOptions;
33542
33573
  /**
33543
33574
  * @see https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-unresolved.md#ignore
33544
33575
  */
package/dist/index.js CHANGED
@@ -608,7 +608,9 @@ var cliEslintConfig = (options = {}, internalOptions = {}) => {
608
608
 
609
609
  // src/configs/import.ts
610
610
  init_esm_shims();
611
- import { createTypeScriptImportResolver } from "eslint-import-resolver-typescript";
611
+ import {
612
+ createTypeScriptImportResolver
613
+ } from "eslint-import-resolver-typescript";
612
614
  import eslintPluginImportX from "eslint-plugin-import-x";
613
615
 
614
616
  // src/utils.ts
@@ -629,7 +631,7 @@ var maybeCall = (fnOrValue, ...args) => typeof fnOrValue === "function" ? fnOrVa
629
631
  // src/configs/import.ts
630
632
  var pluginRenamer = createPluginObjectRenamer("import-x", "import");
631
633
  var importEslintConfig = (options = {}, internalOptions = {}) => {
632
- const { isTypescriptEnabled, noDuplicatesOptions } = options;
634
+ const { isTypescriptEnabled, tsResolverOptions, noDuplicatesOptions } = options;
633
635
  const noUnresolvedIgnores = arraify(options.importPatternsToIgnoreWhenTryingToResolve);
634
636
  const builder = new ConfigEntryBuilder(options, internalOptions);
635
637
  builder.addConfig(["import", { includeDefaultFilesAndIgnores: true }], {
@@ -639,7 +641,10 @@ var importEslintConfig = (options = {}, internalOptions = {}) => {
639
641
  // If the TS resolver goes after the node resolver, `import/no-deprecated` doesn't work
640
642
  // TODO should report?
641
643
  isTypescriptEnabled && createTypeScriptImportResolver({
642
- alwaysTryTypes: true
644
+ alwaysTryTypes: true,
645
+ // Does not resolve paths in sub-directories with their own tsconfigs after 3.8.0 w/o explicit `project`: https://github.com/import-js/eslint-import-resolver-typescript/issues/364
646
+ project: "*/tsconfig*.json",
647
+ ...tsResolverOptions
643
648
  }),
644
649
  eslintPluginImportX.createNodeResolver()
645
650
  ].filter((v) => typeof v === "object"),
@@ -1779,7 +1784,6 @@ var vueEslintConfig = (options, internalOptions = {}) => {
1779
1784
  const inNuxtAppDir = joinPaths.bind(null, options.nuxtOrVueProjectDir);
1780
1785
  const nuxtLayoutsFilesGlob = inNuxtAppDir("layouts/**/*.vue");
1781
1786
  const builder = new ConfigEntryBuilder(options, internalOptions);
1782
- builder.addConfig(["vue/plugin", { doNotIgnoreMarkdown: true }]);
1783
1787
  builder.addConfig(["vue/setup", { doNotIgnoreMarkdown: true }], {
1784
1788
  files: [GLOB_VUE, ...files],
1785
1789
  processor: mergeEslintProcessors(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-un",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "A universal-ish ESLint config aiming to be reasonably strict and easily configurable.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -49,9 +49,10 @@
49
49
  "@eslint-community/eslint-plugin-eslint-comments": "4.4.1",
50
50
  "@eslint/compat": "1.2.7",
51
51
  "@eslint/markdown": "6.2.2",
52
- "@stylistic/eslint-plugin": "4.1.0",
52
+ "@stylistic/eslint-plugin": "4.2.0",
53
53
  "@typescript-eslint/parser": "8.25.0",
54
54
  "@vitest/eslint-plugin": "1.1.36",
55
+ "@vue/compiler-sfc": "3.5.13",
55
56
  "enhanced-resolve": "5.18.1",
56
57
  "eslint-config-flat-gitignore": "2.1.0",
57
58
  "eslint-config-prettier": "10.0.2",
@@ -65,9 +66,9 @@
65
66
  "eslint-plugin-jsdoc": "50.6.3",
66
67
  "eslint-plugin-json-schema-validator": "5.3.1",
67
68
  "eslint-plugin-jsonc": "2.19.1",
68
- "eslint-plugin-n": "17.15.1",
69
+ "eslint-plugin-n": "17.16.1",
69
70
  "eslint-plugin-no-type-assertion": "1.3.0",
70
- "eslint-plugin-package-json": "0.26.0",
71
+ "eslint-plugin-package-json": "0.26.1",
71
72
  "eslint-plugin-perfectionist": "4.9.0",
72
73
  "eslint-plugin-pinia": "0.4.1",
73
74
  "eslint-plugin-prefer-arrow-functions": "3.6.2",
@@ -110,7 +111,7 @@
110
111
  "cross-env": "7.0.3",
111
112
  "eslint": "9.21.0",
112
113
  "eslint-typegen": "2.0.0",
113
- "prettier": "3.5.2",
114
+ "prettier": "3.5.3",
114
115
  "release-it": "18.1.2",
115
116
  "shiki": "3.1.0",
116
117
  "shx": "0.3.4",
@@ -122,5 +123,10 @@
122
123
  },
123
124
  "engines": {
124
125
  "node": ">=18.18.0"
126
+ },
127
+ "overrides": {
128
+ "eslint-processor-vue-blocks": {
129
+ "@vue/compiler-sfc": "$@vue/compiler-sfc"
130
+ }
125
131
  }
126
132
  }