@luxass/eslint-config 4.2.6 → 4.2.8

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.
Files changed (134) hide show
  1. package/README.md +4 -5
  2. package/dist/index.cjs +165 -446
  3. package/dist/index.d.cts +733 -12
  4. package/dist/index.d.ts +733 -12
  5. package/dist/{configs/index.cjs → index.js} +308 -516
  6. package/package.json +51 -85
  7. package/dist/chunk-2IR43M6N.mjs +0 -48
  8. package/dist/chunk-47ISSTHW.mjs +0 -291
  9. package/dist/chunk-4YBQZLPS.mjs +0 -68
  10. package/dist/chunk-4YT54JFZ.mjs +0 -48
  11. package/dist/chunk-5NK24IKQ.mjs +0 -26
  12. package/dist/chunk-AJS3TMZE.mjs +0 -63
  13. package/dist/chunk-C6FE5KXJ.mjs +0 -104
  14. package/dist/chunk-DAJA5AV3.mjs +0 -29
  15. package/dist/chunk-DCOLHWHC.mjs +0 -269
  16. package/dist/chunk-E4RVBKZB.mjs +0 -207
  17. package/dist/chunk-HZNHG5PB.mjs +0 -45
  18. package/dist/chunk-KOXCJL3C.mjs +0 -109
  19. package/dist/chunk-PFCAWBCD.mjs +0 -93
  20. package/dist/chunk-PFYV2TWZ.mjs +0 -117
  21. package/dist/chunk-QT6FHTFU.mjs +0 -92
  22. package/dist/chunk-RDZJT36Z.mjs +0 -57
  23. package/dist/chunk-RVSUTDCE.mjs +0 -57
  24. package/dist/chunk-TWAETZPX.mjs +0 -149
  25. package/dist/chunk-WSQOWO67.mjs +0 -16
  26. package/dist/chunk-XBASVDU6.mjs +0 -215
  27. package/dist/chunk-XD3UVRU7.mjs +0 -274
  28. package/dist/chunk-XGI647GZ.mjs +0 -81
  29. package/dist/chunk-XMXYE5WC.mjs +0 -183
  30. package/dist/chunk-YNMFVYL6.mjs +0 -69
  31. package/dist/chunk-YO3IYQ2L.mjs +0 -220
  32. package/dist/chunk-YZCJUX6Z.mjs +0 -0
  33. package/dist/configs/comments.cjs +0 -63
  34. package/dist/configs/comments.d.cts +0 -15
  35. package/dist/configs/comments.d.ts +0 -15
  36. package/dist/configs/comments.mjs +0 -6
  37. package/dist/configs/css/tailwindcss.cjs +0 -148
  38. package/dist/configs/css/tailwindcss.d.cts +0 -11
  39. package/dist/configs/css/tailwindcss.d.ts +0 -11
  40. package/dist/configs/css/tailwindcss.mjs +0 -8
  41. package/dist/configs/css/unocss.cjs +0 -133
  42. package/dist/configs/css/unocss.d.cts +0 -11
  43. package/dist/configs/css/unocss.d.ts +0 -11
  44. package/dist/configs/css/unocss.mjs +0 -8
  45. package/dist/configs/data/json.cjs +0 -155
  46. package/dist/configs/data/json.d.cts +0 -11
  47. package/dist/configs/data/json.d.ts +0 -11
  48. package/dist/configs/data/json.mjs +0 -8
  49. package/dist/configs/data/toml.cjs +0 -131
  50. package/dist/configs/data/toml.d.cts +0 -11
  51. package/dist/configs/data/toml.d.ts +0 -11
  52. package/dist/configs/data/toml.mjs +0 -8
  53. package/dist/configs/data/yaml.cjs +0 -143
  54. package/dist/configs/data/yaml.d.cts +0 -11
  55. package/dist/configs/data/yaml.d.ts +0 -11
  56. package/dist/configs/data/yaml.mjs +0 -8
  57. package/dist/configs/docs/jsdoc.cjs +0 -85
  58. package/dist/configs/docs/jsdoc.d.cts +0 -27
  59. package/dist/configs/docs/jsdoc.d.ts +0 -27
  60. package/dist/configs/docs/jsdoc.mjs +0 -7
  61. package/dist/configs/docs/markdown.cjs +0 -164
  62. package/dist/configs/docs/markdown.d.cts +0 -35
  63. package/dist/configs/docs/markdown.d.ts +0 -35
  64. package/dist/configs/docs/markdown.mjs +0 -8
  65. package/dist/configs/formatters.cjs +0 -274
  66. package/dist/configs/formatters.d.cts +0 -11
  67. package/dist/configs/formatters.d.ts +0 -11
  68. package/dist/configs/formatters.mjs +0 -9
  69. package/dist/configs/frameworks/astro.cjs +0 -179
  70. package/dist/configs/frameworks/astro.d.cts +0 -11
  71. package/dist/configs/frameworks/astro.d.ts +0 -11
  72. package/dist/configs/frameworks/astro.mjs +0 -8
  73. package/dist/configs/frameworks/nextjs.cjs +0 -180
  74. package/dist/configs/frameworks/nextjs.d.cts +0 -11
  75. package/dist/configs/frameworks/nextjs.d.ts +0 -11
  76. package/dist/configs/frameworks/nextjs.mjs +0 -8
  77. package/dist/configs/frameworks/react.cjs +0 -377
  78. package/dist/configs/frameworks/react.d.cts +0 -11
  79. package/dist/configs/frameworks/react.d.ts +0 -11
  80. package/dist/configs/frameworks/react.mjs +0 -8
  81. package/dist/configs/frameworks/solid.cjs +0 -360
  82. package/dist/configs/frameworks/solid.d.cts +0 -11
  83. package/dist/configs/frameworks/solid.d.ts +0 -11
  84. package/dist/configs/frameworks/solid.mjs +0 -8
  85. package/dist/configs/frameworks/vue.cjs +0 -293
  86. package/dist/configs/frameworks/vue.d.cts +0 -11
  87. package/dist/configs/frameworks/vue.d.ts +0 -11
  88. package/dist/configs/frameworks/vue.mjs +0 -8
  89. package/dist/configs/ignores.cjs +0 -96
  90. package/dist/configs/ignores.d.cts +0 -15
  91. package/dist/configs/ignores.d.ts +0 -15
  92. package/dist/configs/ignores.mjs +0 -7
  93. package/dist/configs/imports.cjs +0 -104
  94. package/dist/configs/imports.d.cts +0 -23
  95. package/dist/configs/imports.d.ts +0 -23
  96. package/dist/configs/imports.mjs +0 -7
  97. package/dist/configs/index.d.cts +0 -19
  98. package/dist/configs/index.d.ts +0 -19
  99. package/dist/configs/index.mjs +0 -99
  100. package/dist/configs/javascript.cjs +0 -324
  101. package/dist/configs/javascript.d.cts +0 -11
  102. package/dist/configs/javascript.d.ts +0 -11
  103. package/dist/configs/javascript.mjs +0 -7
  104. package/dist/configs/node.cjs +0 -60
  105. package/dist/configs/node.d.cts +0 -15
  106. package/dist/configs/node.d.ts +0 -15
  107. package/dist/configs/node.mjs +0 -6
  108. package/dist/configs/sort.cjs +0 -240
  109. package/dist/configs/sort.d.cts +0 -26
  110. package/dist/configs/sort.d.ts +0 -26
  111. package/dist/configs/sort.mjs +0 -8
  112. package/dist/configs/stylistic.cjs +0 -98
  113. package/dist/configs/stylistic.d.cts +0 -11
  114. package/dist/configs/stylistic.d.ts +0 -11
  115. package/dist/configs/stylistic.mjs +0 -9
  116. package/dist/configs/test.cjs +0 -210
  117. package/dist/configs/test.d.cts +0 -11
  118. package/dist/configs/test.d.ts +0 -11
  119. package/dist/configs/test.mjs +0 -8
  120. package/dist/configs/typescript.cjs +0 -291
  121. package/dist/configs/typescript.d.cts +0 -11
  122. package/dist/configs/typescript.d.ts +0 -11
  123. package/dist/configs/typescript.mjs +0 -8
  124. package/dist/configs/unicorn.cjs +0 -91
  125. package/dist/configs/unicorn.d.cts +0 -15
  126. package/dist/configs/unicorn.d.ts +0 -15
  127. package/dist/configs/unicorn.mjs +0 -6
  128. package/dist/globs.cjs +0 -158
  129. package/dist/globs.d.cts +0 -28
  130. package/dist/globs.d.ts +0 -28
  131. package/dist/globs.mjs +0 -56
  132. package/dist/index.mjs +0 -278
  133. package/dist/types-HqEzZfQU.d.cts +0 -668
  134. package/dist/types-HqEzZfQU.d.ts +0 -668
@@ -1,57 +0,0 @@
1
- import {
2
- interop
3
- } from "./chunk-4YBQZLPS.mjs";
4
-
5
- // src/configs/stylistic.ts
6
- import pluginAntfu from "eslint-plugin-antfu";
7
- var StylisticConfigDefaults = {
8
- indent: 2,
9
- jsx: true,
10
- quotes: "double",
11
- semi: true
12
- };
13
- async function stylistic(options = {}) {
14
- const {
15
- indent,
16
- jsx,
17
- overrides = {},
18
- quotes,
19
- semi
20
- } = {
21
- ...StylisticConfigDefaults,
22
- ...options
23
- };
24
- const pluginStylistic = await interop(import("@stylistic/eslint-plugin"));
25
- const config = pluginStylistic.configs.customize({
26
- flat: true,
27
- indent,
28
- jsx,
29
- pluginName: "style",
30
- quotes,
31
- semi
32
- });
33
- return [
34
- {
35
- name: "luxass:stylistic",
36
- plugins: {
37
- antfu: pluginAntfu,
38
- style: pluginStylistic
39
- },
40
- rules: {
41
- ...config.rules,
42
- "antfu/consistent-list-newline": "error",
43
- "antfu/if-newline": "off",
44
- "antfu/top-level-function": "error",
45
- "curly": ["error", "multi-line", "consistent"],
46
- "style/arrow-parens": ["error", "always", { requireForBlockBody: true }],
47
- "style/brace-style": ["error", "1tbs", { allowSingleLine: true }],
48
- ...overrides
49
- }
50
- }
51
- ];
52
- }
53
-
54
- export {
55
- StylisticConfigDefaults,
56
- stylistic
57
- };
@@ -1,57 +0,0 @@
1
- // src/configs/unicorn.ts
2
- import pluginUnicorn from "eslint-plugin-unicorn";
3
- function unicorn() {
4
- return [
5
- {
6
- name: "luxass:unicorn",
7
- plugins: {
8
- unicorn: pluginUnicorn
9
- },
10
- rules: {
11
- // Pass error message when throwing errors
12
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/error-message.md
13
- "unicorn/error-message": "error",
14
- // Uppercase regex escapes
15
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/escape-case.md
16
- "unicorn/escape-case": "error",
17
- // Array.isArray instead of instanceof
18
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-instanceof-array.md
19
- "unicorn/no-instanceof-array": "error",
20
- // Ban `new Array` as `Array` constructor's params are ambiguous
21
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-new-array.md
22
- "unicorn/no-new-array": "error",
23
- // Prevent deprecated `new Buffer()`
24
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-new-buffer.md
25
- "unicorn/no-new-buffer": "error",
26
- // Lowercase number formatting for octal, hex, binary (0x1'error' instead of 0X1'error')
27
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/number-literal-case.md
28
- "unicorn/number-literal-case": "error",
29
- // textContent instead of innerText
30
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-dom-node-text-content.md
31
- "unicorn/prefer-dom-node-text-content": "error",
32
- // includes over indexOf when checking for existence
33
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-includes.md
34
- "unicorn/prefer-includes": "error",
35
- // Prefer using the node: protocol
36
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md
37
- "unicorn/prefer-node-protocol": "error",
38
- // Prefer using number properties like `Number.isNaN` rather than `isNaN`
39
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-number-properties.md
40
- "unicorn/prefer-number-properties": "error",
41
- // String methods startsWith/endsWith instead of more complicated stuff
42
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-starts-ends-with.md
43
- "unicorn/prefer-string-starts-ends-with": "error",
44
- // Enforce throwing type error when throwing error while checking typeof
45
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-type-error.md
46
- "unicorn/prefer-type-error": "error",
47
- // Use new when throwing error
48
- // https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/throw-new-error.md
49
- "unicorn/throw-new-error": "error"
50
- }
51
- }
52
- ];
53
- }
54
-
55
- export {
56
- unicorn
57
- };
@@ -1,149 +0,0 @@
1
- import {
2
- interop
3
- } from "./chunk-4YBQZLPS.mjs";
4
- import {
5
- GLOB_TESTS
6
- } from "./chunk-KOXCJL3C.mjs";
7
-
8
- // src/custom-rules/utils.ts
9
- import { ESLintUtils } from "@typescript-eslint/utils";
10
- var createRule = ESLintUtils.RuleCreator((ruleName) => `https://github.com/luxass/eslint-config/blob/main/src/custom-rules/${ruleName}/README.md`);
11
-
12
- // src/custom-rules/no-only-tests/index.ts
13
- var RULE_NAME = "no-only-tests";
14
- var DEFAULT_OPTIONS = {
15
- blocks: ["describe", "it", "test"],
16
- focus: ["only"]
17
- };
18
- function getPath(node, path = []) {
19
- if (node) {
20
- const nodeName = node.name || node.property && node.property.name;
21
- if (node.object) {
22
- return getPath(
23
- node.object,
24
- [nodeName, ...path]
25
- );
26
- }
27
- if (node.callee)
28
- return getPath(node.callee, path);
29
- return [nodeName, ...path];
30
- }
31
- return path;
32
- }
33
- var noOnlyTests = createRule({
34
- name: RULE_NAME,
35
- create: (context, [options]) => {
36
- const {
37
- blocks = DEFAULT_OPTIONS.blocks,
38
- focus = DEFAULT_OPTIONS.focus
39
- } = options;
40
- return {
41
- Identifier(node) {
42
- const parent = node.parent?.object;
43
- if (!parent)
44
- return;
45
- if (!focus.includes(node.name))
46
- return;
47
- const callPath = getPath(node.parent).join(".");
48
- const found = blocks.find((block) => {
49
- if (block.endsWith("*")) {
50
- return callPath.startsWith(block.replace(/\*$/, ""));
51
- }
52
- return callPath.startsWith(`${block}.`);
53
- });
54
- if (found) {
55
- context.report({
56
- data: { block: callPath.split(".")[0], focus: node.name },
57
- messageId: "not-permitted",
58
- node
59
- });
60
- }
61
- }
62
- };
63
- },
64
- defaultOptions: [
65
- {
66
- blocks: ["describe", "it", "test"],
67
- focus: ["only"]
68
- }
69
- ],
70
- meta: {
71
- docs: {
72
- description: "disallow .only blocks in tests",
73
- recommended: "recommended"
74
- },
75
- messages: {
76
- "not-permitted": "{{ block }}.{{ focus }} not permitted"
77
- },
78
- schema: [
79
- {
80
- additionalProperties: false,
81
- properties: {
82
- blocks: {
83
- items: {
84
- type: "string"
85
- },
86
- type: "array",
87
- uniqueItems: true
88
- },
89
- focus: {
90
- items: {
91
- type: "string"
92
- },
93
- type: "array",
94
- uniqueItems: true
95
- }
96
- },
97
- type: "object"
98
- }
99
- ],
100
- type: "layout"
101
- }
102
- });
103
-
104
- // src/configs/test.ts
105
- async function test(options = {}) {
106
- const {
107
- editor = false,
108
- files = GLOB_TESTS,
109
- overrides = {}
110
- } = options;
111
- const [
112
- pluginVitest
113
- ] = await Promise.all([
114
- interop(import("eslint-plugin-vitest"))
115
- ]);
116
- return [
117
- {
118
- name: "luxass:test:setup",
119
- plugins: {
120
- test: {
121
- ...pluginVitest,
122
- rules: {
123
- ...pluginVitest.rules,
124
- "no-only-tests": noOnlyTests
125
- }
126
- }
127
- }
128
- },
129
- {
130
- name: "luxass:test:rules",
131
- files,
132
- rules: {
133
- "test/consistent-test-it": [
134
- "error",
135
- { fn: "it", withinDescribe: "it" }
136
- ],
137
- "test/no-identical-title": "error",
138
- "test/no-only-tests": editor ? "off" : "error",
139
- "test/prefer-hooks-in-order": "error",
140
- "test/prefer-lowercase-title": "error",
141
- ...overrides
142
- }
143
- }
144
- ];
145
- }
146
-
147
- export {
148
- test
149
- };
@@ -1,16 +0,0 @@
1
- import {
2
- GLOB_EXCLUDE
3
- } from "./chunk-KOXCJL3C.mjs";
4
-
5
- // src/configs/ignores.ts
6
- function ignores() {
7
- return [
8
- {
9
- ignores: GLOB_EXCLUDE
10
- }
11
- ];
12
- }
13
-
14
- export {
15
- ignores
16
- };
@@ -1,215 +0,0 @@
1
- // src/configs/sort.ts
2
- function sortPackageJson() {
3
- return [
4
- {
5
- name: "luxass:sort-package-json",
6
- files: ["**/package.json"],
7
- rules: {
8
- "jsonc/sort-array-values": [
9
- "error",
10
- {
11
- order: { type: "asc" },
12
- pathPattern: "^files$"
13
- }
14
- ],
15
- "jsonc/sort-keys": [
16
- "error",
17
- {
18
- order: [
19
- "name",
20
- "displayName",
21
- "version",
22
- "description",
23
- "type",
24
- "private",
25
- "author",
26
- "publisher",
27
- "packageManager",
28
- "license",
29
- "funding",
30
- "homepage",
31
- "repository",
32
- "bugs",
33
- "keywords",
34
- "categories",
35
- "sideEffects",
36
- "exports",
37
- "main",
38
- "module",
39
- "unpkg",
40
- "jsdelivr",
41
- "types",
42
- "typesVersions",
43
- "bin",
44
- "icon",
45
- "files",
46
- "engines",
47
- "activationEvents",
48
- "contributes",
49
- "scripts",
50
- "peerDependencies",
51
- "peerDependenciesMeta",
52
- "dependencies",
53
- "optionalDependencies",
54
- "devDependencies",
55
- "pnpm",
56
- "overrides",
57
- "resolutions",
58
- "husky",
59
- "simple-git-hooks",
60
- "lint-staged",
61
- "eslintConfig"
62
- ],
63
- pathPattern: "^$"
64
- },
65
- {
66
- order: { type: "asc" },
67
- pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies$"
68
- },
69
- {
70
- order: { type: "asc" },
71
- pathPattern: "^resolutions$"
72
- },
73
- {
74
- order: { type: "asc" },
75
- pathPattern: "^pnpm.overrides$"
76
- },
77
- {
78
- order: ["types", "import", "require", "default"],
79
- pathPattern: "^exports.*$"
80
- }
81
- ]
82
- }
83
- }
84
- ];
85
- }
86
- function sortTsconfig() {
87
- return [
88
- {
89
- name: "luxass:sort-tsconfig",
90
- files: ["**/tsconfig.json", "**/tsconfig.*.json"],
91
- rules: {
92
- "jsonc/sort-keys": [
93
- "error",
94
- {
95
- order: [
96
- "extends",
97
- "compilerOptions",
98
- "references",
99
- "files",
100
- "include",
101
- "exclude"
102
- ],
103
- pathPattern: "^$"
104
- },
105
- {
106
- order: [
107
- /* Projects */
108
- "incremental",
109
- "composite",
110
- "tsBuildInfoFile",
111
- "disableSourceOfProjectReferenceRedirect",
112
- "disableSolutionSearching",
113
- "disableReferencedProjectLoad",
114
- /* Language and Environment */
115
- "target",
116
- "jsx",
117
- "jsxFactory",
118
- "jsxFragmentFactory",
119
- "jsxImportSource",
120
- "lib",
121
- "moduleDetection",
122
- "noLib",
123
- "reactNamespace",
124
- "useDefineForClassFields",
125
- "emitDecoratorMetadata",
126
- "experimentalDecorators",
127
- /* Modules */
128
- "baseUrl",
129
- "rootDir",
130
- "rootDirs",
131
- "customConditions",
132
- "module",
133
- "moduleResolution",
134
- "moduleSuffixes",
135
- "noResolve",
136
- "paths",
137
- "resolveJsonModule",
138
- "resolvePackageJsonExports",
139
- "resolvePackageJsonImports",
140
- "typeRoots",
141
- "types",
142
- "allowArbitraryExtensions",
143
- "allowImportingTsExtensions",
144
- "allowUmdGlobalAccess",
145
- /* JavaScript Support */
146
- "allowJs",
147
- "checkJs",
148
- "maxNodeModuleJsDepth",
149
- /* Type Checking */
150
- "strict",
151
- "strictBindCallApply",
152
- "strictFunctionTypes",
153
- "strictNullChecks",
154
- "strictPropertyInitialization",
155
- "allowUnreachableCode",
156
- "allowUnusedLabels",
157
- "alwaysStrict",
158
- "exactOptionalPropertyTypes",
159
- "noFallthroughCasesInSwitch",
160
- "noImplicitAny",
161
- "noImplicitOverride",
162
- "noImplicitReturns",
163
- "noImplicitThis",
164
- "noPropertyAccessFromIndexSignature",
165
- "noUncheckedIndexedAccess",
166
- "noUnusedLocals",
167
- "noUnusedParameters",
168
- "useUnknownInCatchVariables",
169
- /* Emit */
170
- "declaration",
171
- "declarationDir",
172
- "declarationMap",
173
- "downlevelIteration",
174
- "emitBOM",
175
- "emitDeclarationOnly",
176
- "importHelpers",
177
- "importsNotUsedAsValues",
178
- "inlineSourceMap",
179
- "inlineSources",
180
- "mapRoot",
181
- "newLine",
182
- "noEmit",
183
- "noEmitHelpers",
184
- "noEmitOnError",
185
- "outDir",
186
- "outFile",
187
- "preserveConstEnums",
188
- "preserveValueImports",
189
- "removeComments",
190
- "sourceMap",
191
- "sourceRoot",
192
- "stripInternal",
193
- /* Interop Constraints */
194
- "allowSyntheticDefaultImports",
195
- "esModuleInterop",
196
- "forceConsistentCasingInFileNames",
197
- "isolatedModules",
198
- "preserveSymlinks",
199
- "verbatimModuleSyntax",
200
- /* Completeness */
201
- "skipDefaultLibCheck",
202
- "skipLibCheck"
203
- ],
204
- pathPattern: "^compilerOptions$"
205
- }
206
- ]
207
- }
208
- }
209
- ];
210
- }
211
-
212
- export {
213
- sortPackageJson,
214
- sortTsconfig
215
- };