@standard-config/oxlint 1.0.0

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/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright © Dom Porada <dom@dom.engineering> (https://dom.engineering)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,49 @@
1
+ [![](https://img.shields.io/npm/v/%40standard-config%2Foxlint)](https://www.npmjs.com/package/@standard-config/oxlint)
2
+ [![](https://img.shields.io/github/actions/workflow/status/standard-config/oxlint/test.yaml)](https://github.com/standard-config/oxlint/actions/workflows/test.yaml)
3
+ [![](https://img.shields.io/codecov/c/github/standard-config/oxlint)](https://codecov.io/github/standard-config/oxlint)
4
+
5
+ # @standard-config/oxlint
6
+
7
+ Curated Oxlint config with sensible defaults.
8
+
9
+ ## Install
10
+
11
+ ```sh
12
+ npm install --save-dev @standard-config/oxlint
13
+ ```
14
+
15
+ ```sh
16
+ pnpm add --save-dev @standard-config/oxlint
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ Create your `oxlint.config.ts`:
22
+
23
+ ```ts
24
+ import { defineConfig } from '@standard-config/oxlint';
25
+
26
+ export default defineConfig();
27
+ ```
28
+
29
+ You can override the defaults by passing your own [config options](https://oxc.rs/docs/guide/usage/linter/config-file-reference.html).
30
+
31
+ ```ts
32
+ import { defineConfig } from '@standard-config/oxlint';
33
+
34
+ export default defineConfig({
35
+ rules: {
36
+ 'import/no-unassigned-import': 'off',
37
+ },
38
+ });
39
+ ```
40
+
41
+ ## Related
42
+
43
+ - [**@standard-config/eslint**](https://github.com/standard-config/eslint)
44
+ - [**@standard-config/prettier**](https://github.com/standard-config/prettier)
45
+ - [**@standard-config/tsconfig**](https://github.com/standard-config/tsconfig)
46
+
47
+ ## License
48
+
49
+ MIT © [Dom Porada](https://dom.engineering)
@@ -0,0 +1,23 @@
1
+ import { OxlintConfig, OxlintOverride } from "oxlint";
2
+
3
+ //#region src/types/index.d.ts
4
+ type LinterConfigEntry = Omit<OxlintConfig, 'files' | 'ignorePatterns' | 'overrides'>;
5
+ type LinterConfigOverrideEntry = Omit<OxlintOverride, 'files'>;
6
+ //#endregion
7
+ //#region src/config-base/index.d.ts
8
+ declare const config: LinterConfigEntry;
9
+ //#endregion
10
+ //#region src/config-config-files/index.d.ts
11
+ declare const config$1: LinterConfigOverrideEntry;
12
+ //#endregion
13
+ //#region src/config-test-files/index.d.ts
14
+ declare const config$2: LinterConfigOverrideEntry;
15
+ //#endregion
16
+ //#region src/config-type-definitions/index.d.ts
17
+ declare const config$3: LinterConfigOverrideEntry;
18
+ //#endregion
19
+ //#region src/define-config/index.d.ts
20
+ declare function defineConfig(config?: OxlintConfig): OxlintConfig;
21
+ //#endregion
22
+ export { config as configBase, config$1 as configConfigFiles, config$2 as configTestFiles, config$3 as configTypeDefinitions, defineConfig };
23
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":["OxlintConfig","OxlintOverride","LinterConfigEntry","Omit","LinterConfigOverrideEntry"],"sources":["../src/types/index.d.ts","../src/config-base/index.ts","../src/config-config-files/index.ts","../src/config-test-files/index.ts","../src/config-type-definitions/index.ts","../src/define-config/index.ts"],"mappings":";;;KAEYE,iBAAAA,GAAoBC,IAAAA,CAC/BH,YAAAA;AAAAA,KAIWI,yBAAAA,GAA4BD,IAAAA,CAAKF,cAAAA;;;cCLvC,MAAA,EAAQ,iBAAA;;;cCAR,QAAA,EAAQ,yBAAA;;;cCAR,QAAA,EAAQ,yBAAA;;;cCAR,QAAA,EAAQ,yBAAA;;;iBCMU,YAAA,CAAa,MAAA,GAAQ,YAAA,GAAoB,YAAA"}
package/dist/index.mjs ADDED
@@ -0,0 +1,246 @@
1
+ import { defineConfig as defineConfig$1 } from "oxlint";
2
+ import defineClone from "rfdc";
3
+
4
+ //#region src/config-base/index.ts
5
+ const config$3 = {
6
+ plugins: [
7
+ "eslint",
8
+ "import",
9
+ "jest",
10
+ "node",
11
+ "oxc",
12
+ "promise",
13
+ "typescript",
14
+ "unicorn",
15
+ "vitest"
16
+ ],
17
+ categories: {
18
+ correctness: "error",
19
+ pedantic: "error",
20
+ perf: "error",
21
+ restriction: "error",
22
+ style: "error",
23
+ suspicious: "error"
24
+ },
25
+ settings: { vitest: { typecheck: true } },
26
+ rules: {
27
+ "eslint/accessor-pairs": ["error", { enforceForClassMembers: true }],
28
+ "eslint/array-callback-return": ["error", { allowImplicit: true }],
29
+ "eslint/arrow-body-style": "off",
30
+ "eslint/capitalized-comments": "off",
31
+ "eslint/func-names": "off",
32
+ "eslint/func-style": [
33
+ "error",
34
+ "declaration",
35
+ { allowArrowFunctions: true }
36
+ ],
37
+ "eslint/grouped-accessor-pairs": ["error", "getBeforeSet"],
38
+ "eslint/id-length": "off",
39
+ "eslint/init-declarations": "off",
40
+ "eslint/max-lines": "off",
41
+ "eslint/max-lines-per-function": "off",
42
+ "eslint/max-params": "off",
43
+ "eslint/max-statements": "off",
44
+ "eslint/new-cap": "off",
45
+ "eslint/no-await-in-loop": "off",
46
+ "eslint/no-continue": "off",
47
+ "eslint/no-duplicate-imports": "off",
48
+ "eslint/no-else-return": ["error", { allowElseIf: false }],
49
+ "eslint/no-empty": ["error", { allowEmptyCatch: true }],
50
+ "eslint/no-magic-numbers": "off",
51
+ "eslint/no-param-reassign": ["error"],
52
+ "eslint/no-return-assign": ["error", "always"],
53
+ "eslint/no-self-assign": ["error", { props: true }],
54
+ "eslint/no-ternary": "off",
55
+ "eslint/no-undefined": "off",
56
+ "eslint/no-unsafe-negation": ["error", { enforceForOrderingRelations: true }],
57
+ "eslint/no-unsafe-optional-chaining": ["error", { disallowArithmeticOperators: true }],
58
+ "eslint/no-unused-expressions": ["error", { enforceForJSX: true }],
59
+ "eslint/no-unused-vars": ["error", {
60
+ argsIgnorePattern: "^_",
61
+ caughtErrorsIgnorePattern: "^_",
62
+ destructuredArrayIgnorePattern: "^_",
63
+ varsIgnorePattern: "^_"
64
+ }],
65
+ "eslint/no-void": "off",
66
+ "eslint/prefer-destructuring": ["error", { enforceForRenamedProperties: false }],
67
+ "eslint/prefer-promise-reject-errors": "off",
68
+ "eslint/prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
69
+ "eslint/require-await": "off",
70
+ "eslint/sort-imports": "off",
71
+ "eslint/sort-keys": "off",
72
+ "eslint/valid-typeof": ["error", { requireStringLiterals: false }],
73
+ "import/exports-last": "off",
74
+ "import/group-exports": "off",
75
+ "import/max-dependencies": "off",
76
+ "import/no-default-export": "off",
77
+ "import/no-named-export": "off",
78
+ "import/no-namespace": "off",
79
+ "import/no-nodejs-modules": "off",
80
+ "import/no-relative-parent-imports": "off",
81
+ "import/no-unassigned-import": "error",
82
+ "import/unambiguous": "warn",
83
+ "oxc/no-async-await": "off",
84
+ "oxc/no-optional-chaining": "off",
85
+ "oxc/no-rest-spread-properties": "off",
86
+ "promise/avoid-new": "off",
87
+ "promise/prefer-await-to-callbacks": "off",
88
+ "typescript/array-type": ["error", {
89
+ default: "array-simple",
90
+ readonly: "generic"
91
+ }],
92
+ "typescript/ban-ts-comment": ["error", {
93
+ "ts-check": true,
94
+ "ts-expect-error": false,
95
+ "ts-ignore": true,
96
+ "ts-nocheck": true
97
+ }],
98
+ "typescript/consistent-type-definitions": ["error", "type"],
99
+ "typescript/consistent-type-imports": ["error", {
100
+ fixStyle: "separate-type-imports",
101
+ prefer: "type-imports"
102
+ }],
103
+ "typescript/explicit-function-return-type": "off",
104
+ "typescript/no-confusing-void-expression": ["error", { ignoreArrowShorthand: true }],
105
+ "typescript/no-explicit-any": "off",
106
+ "typescript/no-misused-promises": ["error", {
107
+ checksConditionals: true,
108
+ checksVoidReturn: false
109
+ }],
110
+ "typescript/no-namespace": ["error", { allowDeclarations: true }],
111
+ "typescript/no-non-null-assertion": "off",
112
+ "typescript/no-restricted-types": ["error", { types: {
113
+ "[]": true,
114
+ "null": true,
115
+ "object": true
116
+ } }],
117
+ "typescript/no-unsafe-type-assertion": "off",
118
+ "typescript/only-throw-error": ["error", {
119
+ allowThrowingAny: false,
120
+ allowThrowingUnknown: true
121
+ }],
122
+ "typescript/prefer-nullish-coalescing": ["error", { ignoreConditionalTests: false }],
123
+ "typescript/prefer-promise-reject-errors": "off",
124
+ "typescript/require-array-sort-compare": ["error", { ignoreStringArrays: true }],
125
+ "typescript/require-await": "warn",
126
+ "typescript/restrict-template-expressions": ["error", { allowNumber: true }],
127
+ "typescript/strict-boolean-expressions": "off",
128
+ "typescript/switch-exhaustiveness-check": ["error", {
129
+ allowDefaultCaseForExhaustiveSwitch: false,
130
+ considerDefaultExhaustiveForUnions: true,
131
+ requireDefaultForNonUnion: true
132
+ }],
133
+ "typescript/unbound-method": "off",
134
+ "unicorn/no-array-callback-reference": "off",
135
+ "unicorn/no-empty-file": "warn",
136
+ "unicorn/no-null": "off",
137
+ "unicorn/no-single-promise-in-promise-methods": "off",
138
+ "unicorn/no-useless-undefined": "off",
139
+ "unicorn/prefer-bigint-literals": "off"
140
+ }
141
+ };
142
+ var config_base_default = config$3;
143
+
144
+ //#endregion
145
+ //#region src/config-config-files/index.ts
146
+ const config$2 = { rules: {
147
+ "import/unambiguous": "off",
148
+ "unicorn/no-empty-file": "off",
149
+ "vitest/require-hook": "off"
150
+ } };
151
+ var config_config_files_default = config$2;
152
+
153
+ //#endregion
154
+ //#region src/config-test-files/index.ts
155
+ const config$1 = { rules: {
156
+ "eslint/no-alert": "off",
157
+ "import/unambiguous": "off",
158
+ "promise/prefer-await-to-then": "off",
159
+ "typescript/ban-ts-comment": "off",
160
+ "typescript/no-confusing-void-expression": "off",
161
+ "typescript/no-empty-function": "off",
162
+ "typescript/no-extraneous-class": "off",
163
+ "typescript/no-unsafe-assignment": "off",
164
+ "typescript/no-unsafe-member-access": "off",
165
+ "unicorn/consistent-function-scoping": "off",
166
+ "unicorn/error-message": "off",
167
+ "unicorn/no-empty-file": "off",
168
+ "vitest/no-conditional-tests": "off",
169
+ "vitest/prefer-to-be-falsy": "off",
170
+ "vitest/prefer-to-be-truthy": "off",
171
+ "vitest/require-top-level-describe": "off"
172
+ } };
173
+ var config_test_files_default = config$1;
174
+
175
+ //#endregion
176
+ //#region src/config-type-definitions/index.ts
177
+ const config = { rules: {
178
+ "import/no-empty-named-blocks": "off",
179
+ "import/no-unassigned-import": "off",
180
+ "import/prefer-default-export": "off",
181
+ "import/unambiguous": "off",
182
+ "typescript/consistent-type-definitions": "off",
183
+ "typescript/no-empty-interface": "off",
184
+ "typescript/no-empty-object-type": "off",
185
+ "typescript/no-restricted-types": "off",
186
+ "unicorn/require-module-specifiers": "off"
187
+ } };
188
+ var config_type_definitions_default = config;
189
+
190
+ //#endregion
191
+ //#region src/clone/index.ts
192
+ var clone_default = defineClone({ circles: true });
193
+
194
+ //#endregion
195
+ //#region src/merge-config/index.ts
196
+ function mergeConfig(baseConfig, extensionConfig) {
197
+ if (!(isObject(baseConfig) && isObject(extensionConfig))) throw new TypeError("Standard Config error: expected config to be an object");
198
+ const result = clone_default(baseConfig);
199
+ for (const [key, value] of Object.entries(clone_default(extensionConfig))) {
200
+ if (value === void 0 || value === null) {
201
+ delete result[key];
202
+ continue;
203
+ }
204
+ if (isArray(value) && isArray(result[key])) {
205
+ result[key] = [...result[key], ...value];
206
+ continue;
207
+ }
208
+ result[key] = {
209
+ ...result[key],
210
+ ...value
211
+ };
212
+ }
213
+ return result;
214
+ }
215
+ function isArray(value) {
216
+ return Array.isArray(value);
217
+ }
218
+ function isObject(value) {
219
+ return typeof value === "object" && value !== null;
220
+ }
221
+
222
+ //#endregion
223
+ //#region src/define-config/index.ts
224
+ function defineConfig(config = {}) {
225
+ return defineConfig$1(mergeConfig({
226
+ ...config_base_default,
227
+ overrides: [
228
+ {
229
+ files: ["**/*.d.{ts,cts,mts}"],
230
+ ...config_type_definitions_default
231
+ },
232
+ {
233
+ files: ["**/*.test.{ts,tsx,cts,mts}"],
234
+ ...config_test_files_default
235
+ },
236
+ {
237
+ files: ["**/*.config.{ts,cts,mts}", "**/*.setup.{ts,cts,mts}"],
238
+ ...config_config_files_default
239
+ }
240
+ ]
241
+ }, config));
242
+ }
243
+
244
+ //#endregion
245
+ export { config_base_default as configBase, config_config_files_default as configConfigFiles, config_test_files_default as configTestFiles, config_type_definitions_default as configTypeDefinitions, defineConfig };
246
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["config","config","config","clone","oxlintDefineConfig","configBase","configTypeDefinitions","configTestFiles","configConfigFiles"],"sources":["../src/config-base/index.ts","../src/config-config-files/index.ts","../src/config-test-files/index.ts","../src/config-type-definitions/index.ts","../src/clone/index.ts","../src/merge-config/index.ts","../src/define-config/index.ts"],"sourcesContent":["import type { LinterConfigEntry } from '../types/index.js';\n\nconst config: LinterConfigEntry = {\n\tplugins: [\n\t\t'eslint',\n\t\t'import',\n\t\t'jest',\n\t\t'node',\n\t\t'oxc',\n\t\t'promise',\n\t\t'typescript',\n\t\t'unicorn',\n\t\t'vitest',\n\t],\n\tcategories: {\n\t\tcorrectness: 'error',\n\t\tpedantic: 'error',\n\t\tperf: 'error',\n\t\trestriction: 'error',\n\t\tstyle: 'error',\n\t\tsuspicious: 'error',\n\t},\n\tsettings: {\n\t\tvitest: {\n\t\t\ttypecheck: true,\n\t\t},\n\t},\n\trules: {\n\t\t'eslint/accessor-pairs': ['error', { enforceForClassMembers: true }],\n\t\t'eslint/array-callback-return': ['error', { allowImplicit: true }],\n\t\t'eslint/arrow-body-style': 'off',\n\t\t'eslint/capitalized-comments': 'off',\n\t\t'eslint/func-names': 'off',\n\t\t'eslint/func-style': [\n\t\t\t'error',\n\t\t\t'declaration',\n\t\t\t{ allowArrowFunctions: true },\n\t\t],\n\t\t'eslint/grouped-accessor-pairs': ['error', 'getBeforeSet'],\n\t\t'eslint/id-length': 'off',\n\t\t'eslint/init-declarations': 'off',\n\t\t'eslint/max-lines': 'off',\n\t\t'eslint/max-lines-per-function': 'off',\n\t\t'eslint/max-params': 'off',\n\t\t'eslint/max-statements': 'off',\n\t\t'eslint/new-cap': 'off',\n\t\t'eslint/no-await-in-loop': 'off',\n\t\t'eslint/no-continue': 'off',\n\t\t'eslint/no-duplicate-imports': 'off',\n\t\t'eslint/no-else-return': ['error', { allowElseIf: false }],\n\t\t'eslint/no-empty': ['error', { allowEmptyCatch: true }],\n\t\t'eslint/no-magic-numbers': 'off',\n\t\t'eslint/no-param-reassign': ['error'],\n\t\t'eslint/no-return-assign': ['error', 'always'],\n\t\t'eslint/no-self-assign': ['error', { props: true }],\n\t\t'eslint/no-ternary': 'off',\n\t\t'eslint/no-undefined': 'off',\n\t\t'eslint/no-unsafe-negation': [\n\t\t\t'error',\n\t\t\t{ enforceForOrderingRelations: true },\n\t\t],\n\t\t'eslint/no-unsafe-optional-chaining': [\n\t\t\t'error',\n\t\t\t{ disallowArithmeticOperators: true },\n\t\t],\n\t\t'eslint/no-unused-expressions': ['error', { enforceForJSX: true }],\n\t\t'eslint/no-unused-vars': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\targsIgnorePattern: '^_',\n\t\t\t\tcaughtErrorsIgnorePattern: '^_',\n\t\t\t\tdestructuredArrayIgnorePattern: '^_',\n\t\t\t\tvarsIgnorePattern: '^_',\n\t\t\t},\n\t\t],\n\t\t'eslint/no-void': 'off',\n\t\t'eslint/prefer-destructuring': [\n\t\t\t'error',\n\t\t\t{ enforceForRenamedProperties: false },\n\t\t],\n\t\t'eslint/prefer-promise-reject-errors': 'off',\n\t\t'eslint/prefer-regex-literals': [\n\t\t\t'error',\n\t\t\t{ disallowRedundantWrapping: true },\n\t\t],\n\t\t'eslint/require-await': 'off',\n\t\t'eslint/sort-imports': 'off',\n\t\t'eslint/sort-keys': 'off',\n\t\t'eslint/valid-typeof': ['error', { requireStringLiterals: false }],\n\t\t'import/exports-last': 'off',\n\t\t'import/group-exports': 'off',\n\t\t'import/max-dependencies': 'off',\n\t\t'import/no-default-export': 'off',\n\t\t'import/no-named-export': 'off',\n\t\t'import/no-namespace': 'off',\n\t\t'import/no-nodejs-modules': 'off',\n\t\t'import/no-relative-parent-imports': 'off',\n\t\t'import/no-unassigned-import': 'error',\n\t\t'import/unambiguous': 'warn',\n\t\t'oxc/no-async-await': 'off',\n\t\t'oxc/no-optional-chaining': 'off',\n\t\t'oxc/no-rest-spread-properties': 'off',\n\t\t'promise/avoid-new': 'off',\n\t\t'promise/prefer-await-to-callbacks': 'off',\n\t\t'typescript/array-type': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tdefault: 'array-simple',\n\t\t\t\treadonly: 'generic',\n\t\t\t},\n\t\t],\n\t\t'typescript/ban-ts-comment': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\t'ts-check': true,\n\t\t\t\t'ts-expect-error': false,\n\t\t\t\t'ts-ignore': true,\n\t\t\t\t'ts-nocheck': true,\n\t\t\t},\n\t\t],\n\t\t'typescript/consistent-type-definitions': ['error', 'type'],\n\t\t'typescript/consistent-type-imports': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tfixStyle: 'separate-type-imports',\n\t\t\t\tprefer: 'type-imports',\n\t\t\t},\n\t\t],\n\t\t'typescript/explicit-function-return-type': 'off',\n\t\t'typescript/no-confusing-void-expression': [\n\t\t\t'error',\n\t\t\t{ ignoreArrowShorthand: true },\n\t\t],\n\t\t'typescript/no-explicit-any': 'off',\n\t\t'typescript/no-misused-promises': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tchecksConditionals: true,\n\t\t\t\tchecksVoidReturn: false,\n\t\t\t},\n\t\t],\n\t\t'typescript/no-namespace': ['error', { allowDeclarations: true }],\n\t\t'typescript/no-non-null-assertion': 'off',\n\t\t'typescript/no-restricted-types': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\ttypes: {\n\t\t\t\t\t'[]': true,\n\t\t\t\t\t'null': true,\n\t\t\t\t\t'object': true,\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\t'typescript/no-unsafe-type-assertion': 'off',\n\t\t'typescript/only-throw-error': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tallowThrowingAny: false,\n\t\t\t\tallowThrowingUnknown: true,\n\t\t\t},\n\t\t],\n\t\t'typescript/prefer-nullish-coalescing': [\n\t\t\t'error',\n\t\t\t{ ignoreConditionalTests: false },\n\t\t],\n\t\t'typescript/prefer-promise-reject-errors': 'off',\n\t\t'typescript/require-array-sort-compare': [\n\t\t\t'error',\n\t\t\t{ ignoreStringArrays: true },\n\t\t],\n\t\t'typescript/require-await': 'warn',\n\t\t'typescript/restrict-template-expressions': [\n\t\t\t'error',\n\t\t\t{ allowNumber: true },\n\t\t],\n\t\t'typescript/strict-boolean-expressions': 'off',\n\t\t'typescript/switch-exhaustiveness-check': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tallowDefaultCaseForExhaustiveSwitch: false,\n\t\t\t\tconsiderDefaultExhaustiveForUnions: true,\n\t\t\t\trequireDefaultForNonUnion: true,\n\t\t\t},\n\t\t],\n\t\t'typescript/unbound-method': 'off',\n\t\t'unicorn/no-array-callback-reference': 'off',\n\t\t'unicorn/no-empty-file': 'warn',\n\t\t'unicorn/no-null': 'off',\n\t\t'unicorn/no-single-promise-in-promise-methods': 'off',\n\t\t'unicorn/no-useless-undefined': 'off',\n\t\t'unicorn/prefer-bigint-literals': 'off',\n\t},\n};\n\nexport default config;\n","import type { LinterConfigOverrideEntry } from '../types/index.d.ts';\n\nconst config: LinterConfigOverrideEntry = {\n\trules: {\n\t\t'import/unambiguous': 'off',\n\t\t'unicorn/no-empty-file': 'off',\n\t\t'vitest/require-hook': 'off',\n\t},\n};\n\nexport default config;\n","import type { LinterConfigOverrideEntry } from '../types/index.d.ts';\n\nconst config: LinterConfigOverrideEntry = {\n\trules: {\n\t\t'eslint/no-alert': 'off',\n\t\t'import/unambiguous': 'off',\n\t\t'promise/prefer-await-to-then': 'off',\n\t\t'typescript/ban-ts-comment': 'off',\n\t\t'typescript/no-confusing-void-expression': 'off',\n\t\t'typescript/no-empty-function': 'off',\n\t\t'typescript/no-extraneous-class': 'off',\n\t\t'typescript/no-unsafe-assignment': 'off',\n\t\t'typescript/no-unsafe-member-access': 'off',\n\t\t'unicorn/consistent-function-scoping': 'off',\n\t\t'unicorn/error-message': 'off',\n\t\t'unicorn/no-empty-file': 'off',\n\t\t'vitest/no-conditional-tests': 'off',\n\t\t'vitest/prefer-to-be-falsy': 'off',\n\t\t'vitest/prefer-to-be-truthy': 'off',\n\t\t'vitest/require-top-level-describe': 'off',\n\t},\n};\n\nexport default config;\n","import type { LinterConfigOverrideEntry } from '../types/index.d.ts';\n\nconst config: LinterConfigOverrideEntry = {\n\trules: {\n\t\t'import/no-empty-named-blocks': 'off',\n\t\t'import/no-unassigned-import': 'off',\n\t\t'import/prefer-default-export': 'off',\n\t\t'import/unambiguous': 'off',\n\t\t'typescript/consistent-type-definitions': 'off',\n\t\t'typescript/no-empty-interface': 'off',\n\t\t'typescript/no-empty-object-type': 'off',\n\t\t'typescript/no-restricted-types': 'off',\n\t\t'unicorn/require-module-specifiers': 'off',\n\t},\n};\n\nexport default config;\n","import defineClone from 'rfdc';\n\nexport default defineClone({ circles: true });\n","/* oxlint-disable eslint/no-unsafe-member-access */\n\nimport type { OxlintConfig } from 'oxlint';\nimport clone from '../clone/index.ts';\n\nexport default function mergeConfig(\n\tbaseConfig: OxlintConfig,\n\textensionConfig: OxlintConfig\n): OxlintConfig {\n\tif (!(isObject(baseConfig) && isObject(extensionConfig))) {\n\t\tthrow new TypeError(\n\t\t\t'Standard Config error: expected config to be an object'\n\t\t);\n\t}\n\n\tconst result = clone(baseConfig);\n\n\tfor (const [key, value] of Object.entries(\n\t\tclone(extensionConfig)\n\t) as ReadonlyArray<[keyof OxlintConfig, unknown]>) {\n\t\tif (value === undefined || value === null) {\n\t\t\t/* oxlint-disable-next-line typescript/no-dynamic-delete */\n\t\t\tdelete result[key];\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (isArray(value) && isArray(result[key])) {\n\t\t\t(result as any)[key] = [...result[key], ...value];\n\t\t\tcontinue;\n\t\t}\n\n\t\t/* oxlint-disable-next-line typescript/no-misused-spread */\n\t\t(result as any)[key] = { ...result[key], ...value };\n\t}\n\n\treturn result;\n}\n\nfunction isArray(value: unknown): value is unknown[] {\n\treturn Array.isArray(value);\n}\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === 'object' && value !== null;\n}\n","import type { OxlintConfig } from 'oxlint';\nimport { defineConfig as oxlintDefineConfig } from 'oxlint';\nimport configBase from '../config-base/index.ts';\nimport configConfigFiles from '../config-config-files/index.ts';\nimport configTestFiles from '../config-test-files/index.ts';\nimport configTypeDefinitions from '../config-type-definitions/index.ts';\nimport mergeConfig from '../merge-config/index.ts';\n\nexport default function defineConfig(config: OxlintConfig = {}): OxlintConfig {\n\tconst baseConfig: OxlintConfig = {\n\t\t...configBase,\n\t\toverrides: [\n\t\t\t{\n\t\t\t\tfiles: ['**/*.d.{ts,cts,mts}'],\n\t\t\t\t...configTypeDefinitions,\n\t\t\t},\n\t\t\t{\n\t\t\t\tfiles: ['**/*.test.{ts,tsx,cts,mts}'],\n\t\t\t\t...configTestFiles,\n\t\t\t},\n\t\t\t{\n\t\t\t\tfiles: ['**/*.config.{ts,cts,mts}', '**/*.setup.{ts,cts,mts}'],\n\t\t\t\t...configConfigFiles,\n\t\t\t},\n\t\t],\n\t};\n\n\tconst extendedConfig = mergeConfig(baseConfig, config);\n\treturn oxlintDefineConfig(extendedConfig);\n}\n"],"mappings":";;;;AAEA,MAAMA,WAA4B;CACjC,SAAS;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,YAAY;EACX,aAAa;EACb,UAAU;EACV,MAAM;EACN,aAAa;EACb,OAAO;EACP,YAAY;EACZ;CACD,UAAU,EACT,QAAQ,EACP,WAAW,MACX,EACD;CACD,OAAO;EACN,yBAAyB,CAAC,SAAS,EAAE,wBAAwB,MAAM,CAAC;EACpE,gCAAgC,CAAC,SAAS,EAAE,eAAe,MAAM,CAAC;EAClE,2BAA2B;EAC3B,+BAA+B;EAC/B,qBAAqB;EACrB,qBAAqB;GACpB;GACA;GACA,EAAE,qBAAqB,MAAM;GAC7B;EACD,iCAAiC,CAAC,SAAS,eAAe;EAC1D,oBAAoB;EACpB,4BAA4B;EAC5B,oBAAoB;EACpB,iCAAiC;EACjC,qBAAqB;EACrB,yBAAyB;EACzB,kBAAkB;EAClB,2BAA2B;EAC3B,sBAAsB;EACtB,+BAA+B;EAC/B,yBAAyB,CAAC,SAAS,EAAE,aAAa,OAAO,CAAC;EAC1D,mBAAmB,CAAC,SAAS,EAAE,iBAAiB,MAAM,CAAC;EACvD,2BAA2B;EAC3B,4BAA4B,CAAC,QAAQ;EACrC,2BAA2B,CAAC,SAAS,SAAS;EAC9C,yBAAyB,CAAC,SAAS,EAAE,OAAO,MAAM,CAAC;EACnD,qBAAqB;EACrB,uBAAuB;EACvB,6BAA6B,CAC5B,SACA,EAAE,6BAA6B,MAAM,CACrC;EACD,sCAAsC,CACrC,SACA,EAAE,6BAA6B,MA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D;AAClD,MAAI,UAAU,UAAa,UAAU,MAAM;AAE1C,UAAO,OAAO;AACd;;AAGD,MAAI,QAAQ,MAAM,IAAI,QAAQ,OAAO,KAAK,EAAE;AAC3C,GAAC,OAAe,OAAO,CAAC,GAAG,OAAO,MAAM,GAAG,MAAM;AACjD;;AAID,EAAC,OAAe,OAAO;GAAE,GAAG,OAAO;GAAM,GAAG;GAAO;;AAGpD,QAAO;;AAGR,SAAS,QAAQ,OAAoC;AACpD,QAAO,MAAM,QAAQ,MAAM;;AAG5B,SAAS,SAAS,OAAkD;AACnE,QAAO,OAAO,UAAU,YAAY,UAAU;;;;;ACnC/C,SAAwB,aAAa,SAAuB,EAAE,EAAgB;AAoB7E,QAAOC,eADgB,YAlBU;EAChC,GAAGC;EACH,WAAW;GACV;IACC,OAAO,CAAC,sBAAsB;IAC9B,GAAGC;IACH;GACD;IACC,OAAO,CAAC,6BAA6B;IACrC,GAAGC;IACH;GACD;IACC,OAAO,CAAC,4BAA4B,0BAA0B;IAC9D,GAAGC;IACH;GACD;EACD,EAE8C,OAAO,CACb"}
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "@standard-config/oxlint",
3
+ "version": "1.0.0",
4
+ "description": "Curated Oxlint config with sensible defaults",
5
+ "license": "MIT",
6
+ "author": {
7
+ "name": "Dom Porada",
8
+ "email": "dom@dom.engineering",
9
+ "url": "https://dom.engineering"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/standard-config/oxlint.git"
14
+ },
15
+ "keywords": [
16
+ "oxc",
17
+ "oxlint",
18
+ "oxlint-config",
19
+ "standard-config",
20
+ "type-aware",
21
+ "typescript"
22
+ ],
23
+ "files": [
24
+ "dist/**"
25
+ ],
26
+ "type": "module",
27
+ "sideEffects": false,
28
+ "exports": "./dist/index.mjs",
29
+ "types": "./dist/index.d.mts",
30
+ "engines": {
31
+ "node": ">=22"
32
+ },
33
+ "packageManager": "pnpm@10.28.2",
34
+ "dependencies": {
35
+ "rfdc": "^1.4.1"
36
+ },
37
+ "peerDependencies": {
38
+ "oxlint": ">=1.43",
39
+ "oxlint-tsgolint": ">=0.11"
40
+ },
41
+ "devDependencies": {
42
+ "@standard-config/eslint": "1.3.0",
43
+ "@standard-config/prettier": "1.8.1",
44
+ "@standard-config/tsconfig": "2.0.2",
45
+ "@vitest/coverage-v8": "4.0.18",
46
+ "eslint": "9.39.2",
47
+ "husky": "9.1.7",
48
+ "jiti": "2.6.1",
49
+ "oxlint": "1.43.0",
50
+ "oxlint-tsgolint": "0.11.4",
51
+ "prettier": "3.8.1",
52
+ "publint": "0.3.17",
53
+ "tsdown": "0.20.1",
54
+ "typescript": "5.9.3",
55
+ "vitest": "4.0.18"
56
+ },
57
+ "scripts": {
58
+ "build": "tsdown",
59
+ "fix": "pnpm format && pnpm lint",
60
+ "format": "prettier --write --ignore-unknown .",
61
+ "format:check": "prettier --check --ignore-unknown .",
62
+ "lint": "oxlint --fix --report-unused-disable-directives --type-aware --type-check && eslint . --fix",
63
+ "lint:check": "oxlint --deny-warnings --report-unused-disable-directives --type-aware --type-check && eslint .",
64
+ "prepack": "pnpm run '/^(format:check|lint:check|test|typecheck)$/' && pnpm build",
65
+ "prepare": "husky",
66
+ "test": "vitest run",
67
+ "typecheck": "tsc --noEmit"
68
+ }
69
+ }