@tanstack/eslint-config 0.3.3 → 0.3.4

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/import.js ADDED
@@ -0,0 +1,25 @@
1
+ //#region src/import.ts
2
+ /**
3
+ * @see https://github.com/un-ts/eslint-plugin-import-x
4
+ */
5
+ const importRules = {
6
+ "import/consistent-type-specifier-style": ["error", "prefer-top-level"],
7
+ "import/first": "error",
8
+ "import/newline-after-import": "error",
9
+ "import/no-commonjs": "error",
10
+ "import/no-duplicates": "error",
11
+ "import/order": ["error", { groups: [
12
+ "builtin",
13
+ "external",
14
+ "internal",
15
+ "parent",
16
+ "sibling",
17
+ "index",
18
+ "object",
19
+ "type"
20
+ ] }]
21
+ };
22
+
23
+ //#endregion
24
+ export { importRules };
25
+ //# sourceMappingURL=import.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"import.js","names":["importRules: Linter.RulesRecord"],"sources":["../src/import.ts"],"sourcesContent":["import type { Linter } from 'eslint'\n\n/**\n * @see https://github.com/un-ts/eslint-plugin-import-x\n */\nexport const importRules: Linter.RulesRecord = {\n /** Bans the use of inline type-only markers for named imports */\n 'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],\n /** Reports any imports that come after non-import statements */\n 'import/first': 'error',\n /** Stylistic preference */\n 'import/newline-after-import': 'error',\n /** No require() or module.exports */\n 'import/no-commonjs': 'error',\n /** Reports if a resolved path is imported more than once */\n 'import/no-duplicates': 'error',\n /** Stylistic preference */\n 'import/order': [\n 'error',\n {\n groups: [\n 'builtin',\n 'external',\n 'internal',\n 'parent',\n 'sibling',\n 'index',\n 'object',\n 'type',\n ],\n },\n ],\n}\n"],"mappings":";;;;AAKA,MAAaA,cAAkC;CAE7C,0CAA0C,CAAC,SAAS,mBAAmB;CAEvE,gBAAgB;CAEhB,+BAA+B;CAE/B,sBAAsB;CAEtB,wBAAwB;CAExB,gBAAgB,CACd,SACA,EACE,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,EACF,CACF;CACF"}
@@ -0,0 +1,7 @@
1
+ import { Linter } from "eslint";
2
+
3
+ //#region src/index.d.ts
4
+ declare const tanstackConfig: Array<Linter.Config>;
5
+ //#endregion
6
+ export { tanstackConfig };
7
+ //# sourceMappingURL=index.d.ts.map
package/dist/index.js ADDED
@@ -0,0 +1,78 @@
1
+ import { javascriptRules } from "./javascript.js";
2
+ import { importRules } from "./import.js";
3
+ import { typescriptRules } from "./typescript.js";
4
+ import { nodeRules } from "./node.js";
5
+ import { stylisticRules } from "./stylistic.js";
6
+ import tseslint from "typescript-eslint";
7
+ import vueParser from "vue-eslint-parser";
8
+ import stylisticPlugin from "@stylistic/eslint-plugin";
9
+ import importPlugin from "eslint-plugin-import-x";
10
+ import nodePlugin from "eslint-plugin-n";
11
+ import globals from "globals";
12
+
13
+ //#region src/index.ts
14
+ const GLOB_EXCLUDE = [
15
+ "**/.nx/**",
16
+ "**/.svelte-kit/**",
17
+ "**/build/**",
18
+ "**/coverage/**",
19
+ "**/dist/**",
20
+ "**/snap/**",
21
+ "**/vite.config.*.timestamp-*.*"
22
+ ];
23
+ const jsRules = {
24
+ ...javascriptRules,
25
+ ...typescriptRules,
26
+ ...importRules,
27
+ ...nodeRules,
28
+ ...stylisticRules
29
+ };
30
+ const jsPlugins = {
31
+ "@stylistic": stylisticPlugin,
32
+ "@typescript-eslint": tseslint.plugin,
33
+ import: importPlugin,
34
+ node: nodePlugin
35
+ };
36
+ const tanstackConfig = [
37
+ {
38
+ name: "tanstack/ignores",
39
+ ignores: GLOB_EXCLUDE
40
+ },
41
+ {
42
+ name: "tanstack/javascript",
43
+ files: ["**/*.{js,ts,tsx}"],
44
+ languageOptions: {
45
+ sourceType: "module",
46
+ ecmaVersion: 2020,
47
+ parser: tseslint.parser,
48
+ parserOptions: {
49
+ project: true,
50
+ parser: tseslint.parser
51
+ },
52
+ globals: { ...globals.browser }
53
+ },
54
+ plugins: jsPlugins,
55
+ rules: jsRules
56
+ },
57
+ {
58
+ name: "tanstack/vue",
59
+ files: ["**/*.vue"],
60
+ languageOptions: {
61
+ parser: vueParser,
62
+ parserOptions: {
63
+ sourceType: "module",
64
+ ecmaVersion: 2020,
65
+ parser: tseslint.parser,
66
+ project: true,
67
+ extraFileExtensions: [".vue"]
68
+ },
69
+ globals: { ...globals.browser }
70
+ },
71
+ plugins: jsPlugins,
72
+ rules: jsRules
73
+ }
74
+ ];
75
+
76
+ //#endregion
77
+ export { tanstackConfig };
78
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["tanstackConfig: Array<Linter.Config>"],"sources":["../src/index.ts"],"sourcesContent":["import tseslint from 'typescript-eslint'\nimport vueParser from 'vue-eslint-parser'\nimport stylisticPlugin from '@stylistic/eslint-plugin'\nimport importPlugin from 'eslint-plugin-import-x'\nimport nodePlugin from 'eslint-plugin-n'\nimport globals from 'globals'\nimport { javascriptRules } from './javascript.js'\nimport { importRules } from './import.js'\nimport { typescriptRules } from './typescript.js'\nimport { nodeRules } from './node.js'\nimport { stylisticRules } from './stylistic.js'\nimport type { Linter } from 'eslint'\n\nconst GLOB_EXCLUDE = [\n '**/.nx/**',\n '**/.svelte-kit/**',\n '**/build/**',\n '**/coverage/**',\n '**/dist/**',\n '**/snap/**',\n '**/vite.config.*.timestamp-*.*',\n]\n\nconst jsRules = {\n ...javascriptRules,\n ...typescriptRules,\n ...importRules,\n ...nodeRules,\n ...stylisticRules,\n}\n\nconst jsPlugins = {\n '@stylistic': stylisticPlugin,\n '@typescript-eslint': tseslint.plugin,\n import: importPlugin,\n node: nodePlugin,\n}\n\nexport const tanstackConfig: Array<Linter.Config> = [\n {\n name: 'tanstack/ignores',\n ignores: GLOB_EXCLUDE,\n },\n {\n name: 'tanstack/javascript',\n files: ['**/*.{js,ts,tsx}'],\n languageOptions: {\n sourceType: 'module',\n ecmaVersion: 2020,\n parser: tseslint.parser,\n parserOptions: {\n project: true,\n parser: tseslint.parser,\n },\n globals: {\n ...globals.browser,\n },\n },\n // @ts-expect-error\n plugins: jsPlugins,\n rules: jsRules,\n },\n {\n name: 'tanstack/vue',\n files: ['**/*.vue'],\n languageOptions: {\n parser: vueParser,\n parserOptions: {\n sourceType: 'module',\n ecmaVersion: 2020,\n parser: tseslint.parser,\n project: true,\n extraFileExtensions: ['.vue'],\n },\n globals: {\n ...globals.browser,\n },\n },\n // @ts-expect-error\n plugins: jsPlugins,\n rules: jsRules,\n },\n]\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAM,UAAU;CACd,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACJ;AAED,MAAM,YAAY;CAChB,cAAc;CACd,sBAAsB,SAAS;CAC/B,QAAQ;CACR,MAAM;CACP;AAED,MAAaA,iBAAuC;CAClD;EACE,MAAM;EACN,SAAS;EACV;CACD;EACE,MAAM;EACN,OAAO,CAAC,mBAAmB;EAC3B,iBAAiB;GACf,YAAY;GACZ,aAAa;GACb,QAAQ,SAAS;GACjB,eAAe;IACb,SAAS;IACT,QAAQ,SAAS;IAClB;GACD,SAAS,EACP,GAAG,QAAQ,SACZ;GACF;EAED,SAAS;EACT,OAAO;EACR;CACD;EACE,MAAM;EACN,OAAO,CAAC,WAAW;EACnB,iBAAiB;GACf,QAAQ;GACR,eAAe;IACb,YAAY;IACZ,aAAa;IACb,QAAQ,SAAS;IACjB,SAAS;IACT,qBAAqB,CAAC,OAAO;IAC9B;GACD,SAAS,EACP,GAAG,QAAQ,SACZ;GACF;EAED,SAAS;EACT,OAAO;EACR;CACF"}
@@ -0,0 +1,55 @@
1
+ //#region src/javascript.ts
2
+ /**
3
+ * @see https://eslint.org/docs/latest/rules/
4
+ */
5
+ const javascriptRules = {
6
+ "for-direction": "error",
7
+ "no-async-promise-executor": "error",
8
+ "no-case-declarations": "error",
9
+ "no-class-assign": "error",
10
+ "no-compare-neg-zero": "error",
11
+ "no-cond-assign": "error",
12
+ "no-constant-binary-expression": "error",
13
+ "no-constant-condition": "error",
14
+ "no-control-regex": "error",
15
+ "no-debugger": "error",
16
+ "no-delete-var": "error",
17
+ "no-dupe-else-if": "error",
18
+ "no-duplicate-case": "error",
19
+ "no-empty-character-class": "error",
20
+ "no-empty-pattern": "error",
21
+ "no-empty-static-block": "error",
22
+ "no-ex-assign": "error",
23
+ "no-extra-boolean-cast": "error",
24
+ "no-fallthrough": "error",
25
+ "no-global-assign": "error",
26
+ "no-invalid-regexp": "error",
27
+ "no-irregular-whitespace": "error",
28
+ "no-loss-of-precision": "error",
29
+ "no-misleading-character-class": "error",
30
+ "no-nonoctal-decimal-escape": "error",
31
+ "no-octal": "error",
32
+ "no-regex-spaces": "error",
33
+ "no-self-assign": "error",
34
+ "no-shadow": "warn",
35
+ "no-shadow-restricted-names": "error",
36
+ "no-sparse-arrays": "error",
37
+ "no-unsafe-finally": "error",
38
+ "no-unsafe-optional-chaining": "error",
39
+ "no-unused-labels": "error",
40
+ "no-unused-private-class-members": "error",
41
+ "no-useless-backreference": "error",
42
+ "no-useless-catch": "error",
43
+ "no-useless-escape": "error",
44
+ "no-var": "error",
45
+ "no-with": "error",
46
+ "prefer-const": "error",
47
+ "require-yield": "error",
48
+ "sort-imports": ["error", { ignoreDeclarationSort: true }],
49
+ "use-isnan": "error",
50
+ "valid-typeof": "error"
51
+ };
52
+
53
+ //#endregion
54
+ export { javascriptRules };
55
+ //# sourceMappingURL=javascript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"javascript.js","names":["javascriptRules: Linter.RulesRecord"],"sources":["../src/javascript.ts"],"sourcesContent":["import type { Linter } from 'eslint'\n\n/**\n * @see https://eslint.org/docs/latest/rules/\n */\nexport const javascriptRules: Linter.RulesRecord = {\n /** TODO */\n 'for-direction': 'error',\n 'no-async-promise-executor': 'error',\n 'no-case-declarations': 'error',\n 'no-class-assign': 'error',\n 'no-compare-neg-zero': 'error',\n 'no-cond-assign': 'error',\n 'no-constant-binary-expression': 'error',\n 'no-constant-condition': 'error',\n 'no-control-regex': 'error',\n 'no-debugger': 'error',\n 'no-delete-var': 'error',\n 'no-dupe-else-if': 'error',\n 'no-duplicate-case': 'error',\n 'no-empty-character-class': 'error',\n 'no-empty-pattern': 'error',\n 'no-empty-static-block': 'error',\n 'no-ex-assign': 'error',\n 'no-extra-boolean-cast': 'error',\n 'no-fallthrough': 'error',\n 'no-global-assign': 'error',\n 'no-invalid-regexp': 'error',\n 'no-irregular-whitespace': 'error',\n 'no-loss-of-precision': 'error',\n 'no-misleading-character-class': 'error',\n 'no-nonoctal-decimal-escape': 'error',\n 'no-octal': 'error',\n 'no-regex-spaces': 'error',\n 'no-self-assign': 'error',\n /** Warn about variable with identical names in the outer scope */\n 'no-shadow': 'warn',\n 'no-shadow-restricted-names': 'error',\n 'no-sparse-arrays': 'error',\n 'no-unsafe-finally': 'error',\n 'no-unsafe-optional-chaining': 'error',\n 'no-unused-labels': 'error',\n 'no-unused-private-class-members': 'error',\n 'no-useless-backreference': 'error',\n 'no-useless-catch': 'error',\n 'no-useless-escape': 'error',\n /** Prefer let and const */\n 'no-var': 'error',\n 'no-with': 'error',\n /** Prefer const if never re-assigned */\n 'prefer-const': 'error',\n 'require-yield': 'error',\n /** Stylistic consistency */\n 'sort-imports': ['error', { ignoreDeclarationSort: true }],\n 'use-isnan': 'error',\n /** Enforce comparing typeof against valid strings */\n 'valid-typeof': 'error',\n}\n"],"mappings":";;;;AAKA,MAAaA,kBAAsC;CAEjD,iBAAiB;CACjB,6BAA6B;CAC7B,wBAAwB;CACxB,mBAAmB;CACnB,uBAAuB;CACvB,kBAAkB;CAClB,iCAAiC;CACjC,yBAAyB;CACzB,oBAAoB;CACpB,eAAe;CACf,iBAAiB;CACjB,mBAAmB;CACnB,qBAAqB;CACrB,4BAA4B;CAC5B,oBAAoB;CACpB,yBAAyB;CACzB,gBAAgB;CAChB,yBAAyB;CACzB,kBAAkB;CAClB,oBAAoB;CACpB,qBAAqB;CACrB,2BAA2B;CAC3B,wBAAwB;CACxB,iCAAiC;CACjC,8BAA8B;CAC9B,YAAY;CACZ,mBAAmB;CACnB,kBAAkB;CAElB,aAAa;CACb,8BAA8B;CAC9B,oBAAoB;CACpB,qBAAqB;CACrB,+BAA+B;CAC/B,oBAAoB;CACpB,mCAAmC;CACnC,4BAA4B;CAC5B,oBAAoB;CACpB,qBAAqB;CAErB,UAAU;CACV,WAAW;CAEX,gBAAgB;CAChB,iBAAiB;CAEjB,gBAAgB,CAAC,SAAS,EAAE,uBAAuB,MAAM,CAAC;CAC1D,aAAa;CAEb,gBAAgB;CACjB"}
package/dist/node.js ADDED
@@ -0,0 +1,9 @@
1
+ //#region src/node.ts
2
+ /**
3
+ * @see https://github.com/eslint-community/eslint-plugin-n
4
+ */
5
+ const nodeRules = { "node/prefer-node-protocol": "error" };
6
+
7
+ //#endregion
8
+ export { nodeRules };
9
+ //# sourceMappingURL=node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.js","names":["nodeRules: Linter.RulesRecord"],"sources":["../src/node.ts"],"sourcesContent":["import type { Linter } from 'eslint'\n\n/**\n * @see https://github.com/eslint-community/eslint-plugin-n\n */\nexport const nodeRules: Linter.RulesRecord = {\n /** Enforce usage of the `node:` prefix for builtin imports */\n 'node/prefer-node-protocol': 'error',\n}\n"],"mappings":";;;;AAKA,MAAaA,YAAgC,EAE3C,6BAA6B,SAC9B"}
@@ -0,0 +1,9 @@
1
+ //#region src/stylistic.ts
2
+ /**
3
+ * @see https://eslint.style/packages/js
4
+ */
5
+ const stylisticRules = { "@stylistic/spaced-comment": "error" };
6
+
7
+ //#endregion
8
+ export { stylisticRules };
9
+ //# sourceMappingURL=stylistic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stylistic.js","names":["stylisticRules: Linter.RulesRecord"],"sources":["../src/stylistic.ts"],"sourcesContent":["import type { Linter } from 'eslint'\n\n/**\n * @see https://eslint.style/packages/js\n */\nexport const stylisticRules: Linter.RulesRecord = {\n /** Enforce consistency of spacing after the start of a comment */\n '@stylistic/spaced-comment': 'error',\n}\n"],"mappings":";;;;AAKA,MAAaA,iBAAqC,EAEhD,6BAA6B,SAC9B"}
@@ -0,0 +1,45 @@
1
+ //#region src/typescript.ts
2
+ /**
3
+ * @see https://typescript-eslint.io/rules/
4
+ */
5
+ const typescriptRules = {
6
+ "@typescript-eslint/array-type": ["error", {
7
+ default: "generic",
8
+ readonly: "generic"
9
+ }],
10
+ "@typescript-eslint/ban-ts-comment": ["error", {
11
+ "ts-expect-error": false,
12
+ "ts-ignore": "allow-with-description"
13
+ }],
14
+ "@typescript-eslint/consistent-type-imports": ["error", { prefer: "type-imports" }],
15
+ "@typescript-eslint/method-signature-style": ["error", "property"],
16
+ "@typescript-eslint/naming-convention": ["error", {
17
+ selector: "typeParameter",
18
+ format: ["PascalCase"],
19
+ leadingUnderscore: "forbid",
20
+ trailingUnderscore: "forbid",
21
+ custom: {
22
+ regex: "^(T|T[A-Z][A-Za-z]+)$",
23
+ match: true
24
+ }
25
+ }],
26
+ "@typescript-eslint/no-duplicate-enum-values": "error",
27
+ "@typescript-eslint/no-extra-non-null-assertion": "error",
28
+ "@typescript-eslint/no-for-in-array": "error",
29
+ "@typescript-eslint/no-inferrable-types": ["error", { ignoreParameters: true }],
30
+ "@typescript-eslint/no-misused-new": "error",
31
+ "@typescript-eslint/no-namespace": "error",
32
+ "@typescript-eslint/no-non-null-asserted-optional-chain": "error",
33
+ "@typescript-eslint/no-unnecessary-condition": "error",
34
+ "@typescript-eslint/no-unnecessary-type-assertion": "error",
35
+ "@typescript-eslint/no-unsafe-function-type": "error",
36
+ "@typescript-eslint/no-wrapper-object-types": "error",
37
+ "@typescript-eslint/prefer-as-const": "error",
38
+ "@typescript-eslint/prefer-for-of": "warn",
39
+ "@typescript-eslint/require-await": "warn",
40
+ "@typescript-eslint/triple-slash-reference": "error"
41
+ };
42
+
43
+ //#endregion
44
+ export { typescriptRules };
45
+ //# sourceMappingURL=typescript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typescript.js","names":["typescriptRules: Linter.RulesRecord"],"sources":["../src/typescript.ts"],"sourcesContent":["import type { Linter } from 'eslint'\n\n/**\n * @see https://typescript-eslint.io/rules/\n */\nexport const typescriptRules: Linter.RulesRecord = {\n /** Prefer Array<T> format */\n '@typescript-eslint/array-type': [\n 'error',\n { default: 'generic', readonly: 'generic' },\n ],\n /** Prevent @ts-ignore, allow @ts-expect-error */\n '@typescript-eslint/ban-ts-comment': [\n 'error',\n {\n 'ts-expect-error': false,\n 'ts-ignore': 'allow-with-description',\n },\n ],\n /** Enforce import type { T } */\n '@typescript-eslint/consistent-type-imports': [\n 'error',\n { prefer: 'type-imports' },\n ],\n /** Shorthand method style is less strict */\n '@typescript-eslint/method-signature-style': ['error', 'property'],\n /** Enforces generic type convention */\n '@typescript-eslint/naming-convention': [\n 'error',\n {\n selector: 'typeParameter',\n format: ['PascalCase'],\n leadingUnderscore: 'forbid',\n trailingUnderscore: 'forbid',\n custom: {\n regex: '^(T|T[A-Z][A-Za-z]+)$',\n match: true,\n },\n },\n ],\n /** Duplicate values can lead to bugs that are hard to track down */\n '@typescript-eslint/no-duplicate-enum-values': 'error',\n /** Using the operator any more than once does nothing */\n '@typescript-eslint/no-extra-non-null-assertion': 'error',\n /** There are several potential bugs with this compared to other loops */\n '@typescript-eslint/no-for-in-array': 'error',\n /** Don't over-define types for simple things like strings */\n '@typescript-eslint/no-inferrable-types': [\n 'error',\n { ignoreParameters: true },\n ],\n /** Enforce valid definition of new and constructor */\n '@typescript-eslint/no-misused-new': 'error',\n /** Disallow TypeScript namespaces */\n '@typescript-eslint/no-namespace': 'error',\n /** Disallow non-null assertions after an optional chain expression */\n '@typescript-eslint/no-non-null-asserted-optional-chain': 'error',\n /** Detects conditionals which will always evaluate truthy or falsy */\n '@typescript-eslint/no-unnecessary-condition': 'error',\n /** Checks if the the explicit type is identical to the inferred type */\n '@typescript-eslint/no-unnecessary-type-assertion': 'error',\n /** Disallow using the unsafe built-in Function type */\n '@typescript-eslint/no-unsafe-function-type': 'error',\n /** Disallow using confusing built-in primitive class wrappers */\n '@typescript-eslint/no-wrapper-object-types': 'error',\n /** Enforce the use of as const over literal type */\n '@typescript-eslint/prefer-as-const': 'error',\n /** Prefer for-of loop over the standard for loop */\n '@typescript-eslint/prefer-for-of': 'warn',\n /** Warn about async functions which have no await expression */\n '@typescript-eslint/require-await': 'warn',\n /** Prefer of ES6-style import declarations */\n '@typescript-eslint/triple-slash-reference': 'error',\n}\n"],"mappings":";;;;AAKA,MAAaA,kBAAsC;CAEjD,iCAAiC,CAC/B,SACA;EAAE,SAAS;EAAW,UAAU;EAAW,CAC5C;CAED,qCAAqC,CACnC,SACA;EACE,mBAAmB;EACnB,aAAa;EACd,CACF;CAED,8CAA8C,CAC5C,SACA,EAAE,QAAQ,gBAAgB,CAC3B;CAED,6CAA6C,CAAC,SAAS,WAAW;CAElE,wCAAwC,CACtC,SACA;EACE,UAAU;EACV,QAAQ,CAAC,aAAa;EACtB,mBAAmB;EACnB,oBAAoB;EACpB,QAAQ;GACN,OAAO;GACP,OAAO;GACR;EACF,CACF;CAED,+CAA+C;CAE/C,kDAAkD;CAElD,sCAAsC;CAEtC,0CAA0C,CACxC,SACA,EAAE,kBAAkB,MAAM,CAC3B;CAED,qCAAqC;CAErC,mCAAmC;CAEnC,0DAA0D;CAE1D,+CAA+C;CAE/C,oDAAoD;CAEpD,8CAA8C;CAE9C,8CAA8C;CAE9C,sCAAsC;CAEtC,oCAAoC;CAEpC,oCAAoC;CAEpC,6CAA6C;CAC9C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/eslint-config",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Shared ESLint config used by TanStack projects.",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
@@ -15,18 +15,17 @@
15
15
  "url": "https://github.com/sponsors/tannerlinsley"
16
16
  },
17
17
  "type": "module",
18
+ "main": "./dist/index.js",
19
+ "module": "./dist/index.js",
20
+ "types": "./dist/index.d.ts",
18
21
  "exports": {
19
- ".": {
20
- "import": {
21
- "types": "./src/index.d.ts",
22
- "default": "./src/index.js"
23
- }
24
- },
22
+ ".": "./dist/index.js",
25
23
  "./package.json": "./package.json"
26
24
  },
27
25
  "preferGlobal": false,
28
26
  "sideEffects": false,
29
27
  "files": [
28
+ "dist",
30
29
  "src"
31
30
  ],
32
31
  "engines": {
@@ -43,11 +42,15 @@
43
42
  },
44
43
  "devDependencies": {
45
44
  "@types/eslint": "^9.6.1",
46
- "eslint": "^9.37.0"
45
+ "eslint": "^9.37.0",
46
+ "tsdown": "^0.17.0"
47
+ },
48
+ "peerDependencies": {
49
+ "eslint": "^8.0.0 || ^9.0.0"
47
50
  },
48
51
  "scripts": {
49
52
  "test:types": "tsc",
50
53
  "test:eslint": "eslint --concurrency=auto ./src",
51
- "test:build": "publint --strict"
54
+ "build": "tsdown"
52
55
  }
53
56
  }
@@ -1,7 +1,9 @@
1
- // https://github.com/un-ts/eslint-plugin-import-x
1
+ import type { Linter } from 'eslint'
2
2
 
3
- /** @type {import('eslint').Linter.RulesRecord} */
4
- export const importRules = {
3
+ /**
4
+ * @see https://github.com/un-ts/eslint-plugin-import-x
5
+ */
6
+ export const importRules: Linter.RulesRecord = {
5
7
  /** Bans the use of inline type-only markers for named imports */
6
8
  'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
7
9
  /** Reports any imports that come after non-import statements */
@@ -9,6 +9,7 @@ import { importRules } from './import.js'
9
9
  import { typescriptRules } from './typescript.js'
10
10
  import { nodeRules } from './node.js'
11
11
  import { stylisticRules } from './stylistic.js'
12
+ import type { Linter } from 'eslint'
12
13
 
13
14
  const GLOB_EXCLUDE = [
14
15
  '**/.nx/**',
@@ -35,8 +36,7 @@ const jsPlugins = {
35
36
  node: nodePlugin,
36
37
  }
37
38
 
38
- /** @type {Array<import('eslint').Linter.Config>} */
39
- export const tanstackConfig = [
39
+ export const tanstackConfig: Array<Linter.Config> = [
40
40
  {
41
41
  name: 'tanstack/ignores',
42
42
  ignores: GLOB_EXCLUDE,
@@ -1,7 +1,9 @@
1
- // https://eslint.org/docs/latest/rules/
1
+ import type { Linter } from 'eslint'
2
2
 
3
- /** @type {import('eslint').Linter.RulesRecord} */
4
- export const javascriptRules = {
3
+ /**
4
+ * @see https://eslint.org/docs/latest/rules/
5
+ */
6
+ export const javascriptRules: Linter.RulesRecord = {
5
7
  /** TODO */
6
8
  'for-direction': 'error',
7
9
  'no-async-promise-executor': 'error',
package/src/node.ts ADDED
@@ -0,0 +1,9 @@
1
+ import type { Linter } from 'eslint'
2
+
3
+ /**
4
+ * @see https://github.com/eslint-community/eslint-plugin-n
5
+ */
6
+ export const nodeRules: Linter.RulesRecord = {
7
+ /** Enforce usage of the `node:` prefix for builtin imports */
8
+ 'node/prefer-node-protocol': 'error',
9
+ }
@@ -0,0 +1,9 @@
1
+ import type { Linter } from 'eslint'
2
+
3
+ /**
4
+ * @see https://eslint.style/packages/js
5
+ */
6
+ export const stylisticRules: Linter.RulesRecord = {
7
+ /** Enforce consistency of spacing after the start of a comment */
8
+ '@stylistic/spaced-comment': 'error',
9
+ }
@@ -1,7 +1,9 @@
1
- // https://typescript-eslint.io/rules/
1
+ import type { Linter } from 'eslint'
2
2
 
3
- /** @type {import('eslint').Linter.RulesRecord} */
4
- export const typescriptRules = {
3
+ /**
4
+ * @see https://typescript-eslint.io/rules/
5
+ */
6
+ export const typescriptRules: Linter.RulesRecord = {
5
7
  /** Prefer Array<T> format */
6
8
  '@typescript-eslint/array-type': [
7
9
  'error',
package/src/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import type { Linter } from 'eslint'
2
-
3
- export const tanstackConfig: Array<Linter.Config>
package/src/node.js DELETED
@@ -1,7 +0,0 @@
1
- // https://github.com/eslint-community/eslint-plugin-n
2
-
3
- /** @type {import('eslint').Linter.RulesRecord} */
4
- export const nodeRules = {
5
- /** Enforce usage of the `node:` prefix for builtin imports */
6
- 'node/prefer-node-protocol': 'error',
7
- }
package/src/stylistic.js DELETED
@@ -1,7 +0,0 @@
1
- // https://eslint.style/packages/js
2
-
3
- /** @type {import('eslint').Linter.RulesRecord} */
4
- export const stylisticRules = {
5
- /** Enforce consistency of spacing after the start of a comment */
6
- '@stylistic/spaced-comment': 'error',
7
- }