@standard-config/eslint 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 +7 -0
- package/README.md +47 -0
- package/dist/index.d.mts +17 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +238 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +71 -0
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,47 @@
|
|
|
1
|
+
[](https://www.npmjs.com/eslint/@standard-config/eslint)
|
|
2
|
+
[](https://github.com/standard-config/eslint/actions/workflows/test.yaml)
|
|
3
|
+
[](https://codecov.io/github/standard-config/eslint)
|
|
4
|
+
|
|
5
|
+
# @standard-config/eslint
|
|
6
|
+
|
|
7
|
+
TypeScript-first ESLint config designed to complement Oxlint and Prettier.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install --save-dev @standard-config/eslint
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
pnpm add --save-dev @standard-config/eslint
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
Create your `eslint.config.ts`:
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { defineConfig } from '@standard-config/eslint';
|
|
25
|
+
|
|
26
|
+
export default defineConfig();
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
You can also include this config in an existing setup.
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import standardConfig from '@standard-config/eslint';
|
|
33
|
+
import { defineConfig } from 'eslint/config';
|
|
34
|
+
|
|
35
|
+
export default defineConfig({
|
|
36
|
+
files: ['**/*.ts'],
|
|
37
|
+
extends: [standardConfig],
|
|
38
|
+
});
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Recommended
|
|
42
|
+
|
|
43
|
+
Try [**@standard-config/prettier**](https://github.com/standard-config/prettier) if you’re looking for a consistent, TypeScript-first Prettier config.
|
|
44
|
+
|
|
45
|
+
## License
|
|
46
|
+
|
|
47
|
+
MIT © [Dom Porada](https://dom.engineering)
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineConfig as defineConfig$1 } from "eslint/config";
|
|
2
|
+
import { Linter } from "eslint";
|
|
3
|
+
|
|
4
|
+
//#region src/config/index.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Standard Config for use in an existing config.
|
|
7
|
+
*/
|
|
8
|
+
declare const config: Linter.Config[];
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/define-config/index.d.ts
|
|
11
|
+
/**
|
|
12
|
+
* Combine Standard Config with optional additional config.
|
|
13
|
+
*/
|
|
14
|
+
declare function defineConfig(...configs: Parameters<typeof defineConfig$1>): ReturnType<typeof defineConfig$1>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { config as default, defineConfig };
|
|
17
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/config/index.ts","../src/define-config/index.ts"],"mappings":";;;;;;;cAUM,MAAA,EAAQ,MAAA,CAAO,MAAA;;;;;;iBCJG,YAAA,CAAA,GACpB,OAAA,EAAS,UAAA,QAAkB,cAAA,IAC5B,UAAA,QAAkB,cAAA"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import pluginFormatting from "eslint-plugin-perfectionist";
|
|
2
|
+
import tseslint from "typescript-eslint";
|
|
3
|
+
import { includeIgnoreFile } from "@eslint/compat";
|
|
4
|
+
import fs from "node:fs";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { defineConfig as defineConfig$1 } from "eslint/config";
|
|
7
|
+
|
|
8
|
+
//#region src/config-formatting-config-files/index.ts
|
|
9
|
+
const config$4 = {
|
|
10
|
+
name: "Formatting (Config Files)",
|
|
11
|
+
plugins: { perfectionist: pluginFormatting },
|
|
12
|
+
rules: { "perfectionist/sort-objects": ["error", {
|
|
13
|
+
customGroups: [
|
|
14
|
+
{
|
|
15
|
+
elementNamePattern: "^extends$",
|
|
16
|
+
groupName: "extends"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
elementNamePattern: "^files$",
|
|
20
|
+
groupName: "files"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
elementNamePattern: "^(ignores|ignorePatterns)$",
|
|
24
|
+
groupName: "ignores"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
elementNamePattern: "^name$",
|
|
28
|
+
groupName: "name"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
elementNamePattern: "^overrides$",
|
|
32
|
+
groupName: "overrides"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
elementNamePattern: "^plugins$",
|
|
36
|
+
groupName: "plugins"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
elementNamePattern: "^rules$",
|
|
40
|
+
groupName: "rules"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
groups: [
|
|
44
|
+
"name",
|
|
45
|
+
"files",
|
|
46
|
+
"extends",
|
|
47
|
+
"ignores",
|
|
48
|
+
"plugins",
|
|
49
|
+
"unknown",
|
|
50
|
+
"rules",
|
|
51
|
+
"overrides"
|
|
52
|
+
],
|
|
53
|
+
newlinesBetween: 0,
|
|
54
|
+
type: "natural"
|
|
55
|
+
}] }
|
|
56
|
+
};
|
|
57
|
+
var config_formatting_config_files_default = config$4;
|
|
58
|
+
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/config-formatting/index.ts
|
|
61
|
+
/**
|
|
62
|
+
* This config is intentionally limited to formatting options
|
|
63
|
+
* not supported by Prettier.
|
|
64
|
+
*/
|
|
65
|
+
const config$3 = {
|
|
66
|
+
name: "Formatting",
|
|
67
|
+
plugins: { perfectionist: pluginFormatting },
|
|
68
|
+
rules: {
|
|
69
|
+
"perfectionist/sort-array-includes": ["error", { type: "natural" }],
|
|
70
|
+
"perfectionist/sort-classes": ["error", {
|
|
71
|
+
groups: ["property", "constructor"],
|
|
72
|
+
type: "natural"
|
|
73
|
+
}],
|
|
74
|
+
"perfectionist/sort-exports": ["error", { type: "natural" }],
|
|
75
|
+
"perfectionist/sort-imports": ["error", {
|
|
76
|
+
groups: [
|
|
77
|
+
["type-builtin", "type-external"],
|
|
78
|
+
"type-internal",
|
|
79
|
+
[
|
|
80
|
+
"type-parent",
|
|
81
|
+
"type-sibling",
|
|
82
|
+
"type-index"
|
|
83
|
+
],
|
|
84
|
+
["value-builtin", "value-external"],
|
|
85
|
+
"value-internal",
|
|
86
|
+
[
|
|
87
|
+
"value-parent",
|
|
88
|
+
"value-sibling",
|
|
89
|
+
"value-index"
|
|
90
|
+
],
|
|
91
|
+
"unknown",
|
|
92
|
+
"style",
|
|
93
|
+
"side-effect",
|
|
94
|
+
"side-effect-style"
|
|
95
|
+
],
|
|
96
|
+
newlinesBetween: 0,
|
|
97
|
+
sortSideEffects: true,
|
|
98
|
+
type: "natural"
|
|
99
|
+
}],
|
|
100
|
+
"perfectionist/sort-interfaces": ["error", {
|
|
101
|
+
groups: [
|
|
102
|
+
"index-signature",
|
|
103
|
+
"unknown",
|
|
104
|
+
"method"
|
|
105
|
+
],
|
|
106
|
+
type: "natural"
|
|
107
|
+
}],
|
|
108
|
+
"perfectionist/sort-intersection-types": ["error", { type: "natural" }],
|
|
109
|
+
"perfectionist/sort-named-exports": ["error", { type: "natural" }],
|
|
110
|
+
"perfectionist/sort-named-imports": ["error", { type: "natural" }],
|
|
111
|
+
"perfectionist/sort-object-types": ["error", {
|
|
112
|
+
groups: [
|
|
113
|
+
"index-signature",
|
|
114
|
+
"unknown",
|
|
115
|
+
"method"
|
|
116
|
+
],
|
|
117
|
+
type: "natural"
|
|
118
|
+
}],
|
|
119
|
+
"perfectionist/sort-objects": [
|
|
120
|
+
"error",
|
|
121
|
+
{
|
|
122
|
+
type: "natural",
|
|
123
|
+
useConfigurationIf: { objectType: "destructured" }
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
type: "unsorted",
|
|
127
|
+
useConfigurationIf: { objectType: "non-destructured" }
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"perfectionist/sort-union-types": ["error", {
|
|
131
|
+
customGroups: [{
|
|
132
|
+
elementNamePattern: "^false$",
|
|
133
|
+
groupName: "false"
|
|
134
|
+
}, {
|
|
135
|
+
elementNamePattern: "^never$",
|
|
136
|
+
groupName: "never"
|
|
137
|
+
}],
|
|
138
|
+
groups: [
|
|
139
|
+
"unknown",
|
|
140
|
+
"tuple",
|
|
141
|
+
"false",
|
|
142
|
+
"nullish",
|
|
143
|
+
"never"
|
|
144
|
+
],
|
|
145
|
+
type: "natural"
|
|
146
|
+
}]
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
var config_formatting_default = config$3;
|
|
150
|
+
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region src/config-typescript-settings/index.ts
|
|
153
|
+
const config$2 = {
|
|
154
|
+
name: "TypeScript (Linter Settings)",
|
|
155
|
+
languageOptions: {
|
|
156
|
+
parser: tseslint.parser,
|
|
157
|
+
parserOptions: { projectService: true }
|
|
158
|
+
},
|
|
159
|
+
linterOptions: {
|
|
160
|
+
reportUnusedDisableDirectives: "error",
|
|
161
|
+
reportUnusedInlineConfigs: "error"
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
var config_typescript_settings_default = config$2;
|
|
165
|
+
|
|
166
|
+
//#endregion
|
|
167
|
+
//#region src/config-typescript/index.ts
|
|
168
|
+
/**
|
|
169
|
+
* This config is intentionally limited to rules not supported by Oxlint.
|
|
170
|
+
*/
|
|
171
|
+
const config$1 = {
|
|
172
|
+
name: "TypeScript",
|
|
173
|
+
plugins: { "@typescript-eslint": tseslint.plugin },
|
|
174
|
+
rules: {
|
|
175
|
+
"camelcase": ["error", { properties: "always" }],
|
|
176
|
+
"dot-notation": "error",
|
|
177
|
+
"func-name-matching": [
|
|
178
|
+
"error",
|
|
179
|
+
"never",
|
|
180
|
+
{ considerPropertyDescriptor: true }
|
|
181
|
+
],
|
|
182
|
+
"@typescript-eslint/consistent-type-assertions": ["error", {
|
|
183
|
+
assertionStyle: "as",
|
|
184
|
+
objectLiteralTypeAssertions: "allow-as-parameter"
|
|
185
|
+
}],
|
|
186
|
+
"@typescript-eslint/consistent-type-exports": ["error", { fixMixedExportsWithInlineTypeSpecifier: true }],
|
|
187
|
+
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
|
188
|
+
"@typescript-eslint/no-useless-default-assignment": "error",
|
|
189
|
+
"@typescript-eslint/parameter-properties": ["error", { prefer: "parameter-property" }],
|
|
190
|
+
"@typescript-eslint/prefer-readonly": "error"
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
var config_typescript_default = config$1;
|
|
194
|
+
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region src/include-ignore-file/index.ts
|
|
197
|
+
const ignoreFilePath = path.resolve(".gitignore");
|
|
198
|
+
const ignoreFilePathExists = fs.existsSync(ignoreFilePath);
|
|
199
|
+
function includeIgnoreFile$1(configs) {
|
|
200
|
+
return ignoreFilePathExists ? [includeIgnoreFile(ignoreFilePath, ".gitignore"), ...configs] : configs;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
//#endregion
|
|
204
|
+
//#region src/config/index.ts
|
|
205
|
+
/**
|
|
206
|
+
* Standard Config for use in an existing config.
|
|
207
|
+
*/
|
|
208
|
+
const config = includeIgnoreFile$1([
|
|
209
|
+
{
|
|
210
|
+
name: "Ignored Paths",
|
|
211
|
+
ignores: ["**/fixtures/**"]
|
|
212
|
+
},
|
|
213
|
+
config_typescript_settings_default,
|
|
214
|
+
config_typescript_default,
|
|
215
|
+
config_formatting_default,
|
|
216
|
+
{
|
|
217
|
+
files: ["**/*.config.*"],
|
|
218
|
+
...config_formatting_config_files_default
|
|
219
|
+
}
|
|
220
|
+
]);
|
|
221
|
+
var config_default = config;
|
|
222
|
+
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region src/define-config/index.ts
|
|
225
|
+
/**
|
|
226
|
+
* Combine Standard Config with optional additional config.
|
|
227
|
+
*/
|
|
228
|
+
function defineConfig(...configs) {
|
|
229
|
+
return defineConfig$1({
|
|
230
|
+
name: "Standard Config",
|
|
231
|
+
files: ["**/*.{ts,tsx,cts,mts}"],
|
|
232
|
+
extends: [config_default]
|
|
233
|
+
}, ...configs);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
//#endregion
|
|
237
|
+
export { config_default as default, defineConfig };
|
|
238
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["config","config","config","config","includeIgnoreFile","_includeIgnoreFile","includeIgnoreFile","configTypeScriptSettings","configTypeScript","configFormatting","configFormattingConfigFiles","_defineConfig","config"],"sources":["../src/config-formatting-config-files/index.ts","../src/config-formatting/index.ts","../src/config-typescript-settings/index.ts","../src/config-typescript/index.ts","../src/include-ignore-file/index.ts","../src/config/index.ts","../src/define-config/index.ts"],"sourcesContent":["import type { Linter } from 'eslint';\nimport pluginFormatting from 'eslint-plugin-perfectionist';\n\nconst config: Linter.Config = {\n\tname: 'Formatting (Config Files)',\n\tplugins: {\n\t\tperfectionist: pluginFormatting,\n\t},\n\trules: {\n\t\t'perfectionist/sort-objects': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tcustomGroups: [\n\t\t\t\t\t{\n\t\t\t\t\t\telementNamePattern: '^extends$',\n\t\t\t\t\t\tgroupName: 'extends',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\telementNamePattern: '^files$',\n\t\t\t\t\t\tgroupName: 'files',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\telementNamePattern: '^(ignores|ignorePatterns)$',\n\t\t\t\t\t\tgroupName: 'ignores',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\telementNamePattern: '^name$',\n\t\t\t\t\t\tgroupName: 'name',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\telementNamePattern: '^overrides$',\n\t\t\t\t\t\tgroupName: 'overrides',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\telementNamePattern: '^plugins$',\n\t\t\t\t\t\tgroupName: 'plugins',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\telementNamePattern: '^rules$',\n\t\t\t\t\t\tgroupName: 'rules',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tgroups: [\n\t\t\t\t\t'name',\n\t\t\t\t\t'files',\n\t\t\t\t\t'extends',\n\t\t\t\t\t'ignores',\n\t\t\t\t\t'plugins',\n\t\t\t\t\t'unknown',\n\t\t\t\t\t'rules',\n\t\t\t\t\t'overrides',\n\t\t\t\t],\n\t\t\t\tnewlinesBetween: 0,\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t},\n};\n\nexport default config;\n","import type { Linter } from 'eslint';\nimport pluginFormatting from 'eslint-plugin-perfectionist';\n\n/**\n * This config is intentionally limited to formatting options\n * not supported by Prettier.\n */\nconst config: Linter.Config = {\n\tname: 'Formatting',\n\tplugins: {\n\t\tperfectionist: pluginFormatting,\n\t},\n\trules: {\n\t\t'perfectionist/sort-array-includes': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-classes': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tgroups: ['property', 'constructor'],\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-exports': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-imports': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tgroups: [\n\t\t\t\t\t['type-builtin', 'type-external'],\n\t\t\t\t\t'type-internal',\n\t\t\t\t\t['type-parent', 'type-sibling', 'type-index'],\n\t\t\t\t\t['value-builtin', 'value-external'],\n\t\t\t\t\t'value-internal',\n\t\t\t\t\t['value-parent', 'value-sibling', 'value-index'],\n\t\t\t\t\t'unknown',\n\t\t\t\t\t'style',\n\t\t\t\t\t'side-effect',\n\t\t\t\t\t'side-effect-style',\n\t\t\t\t],\n\t\t\t\tnewlinesBetween: 0,\n\t\t\t\tsortSideEffects: true,\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-interfaces': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tgroups: ['index-signature', 'unknown', 'method'],\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-intersection-types': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-named-exports': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-named-imports': ['error', { type: 'natural' }],\n\t\t'perfectionist/sort-object-types': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tgroups: ['index-signature', 'unknown', 'method'],\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-objects': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\ttype: 'natural',\n\t\t\t\tuseConfigurationIf: {\n\t\t\t\t\tobjectType: 'destructured',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'unsorted',\n\t\t\t\tuseConfigurationIf: {\n\t\t\t\t\tobjectType: 'non-destructured',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\t'perfectionist/sort-union-types': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tcustomGroups: [\n\t\t\t\t\t{\n\t\t\t\t\t\telementNamePattern: '^false$',\n\t\t\t\t\t\tgroupName: 'false',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\telementNamePattern: '^never$',\n\t\t\t\t\t\tgroupName: 'never',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tgroups: ['unknown', 'tuple', 'false', 'nullish', 'never'],\n\t\t\t\ttype: 'natural',\n\t\t\t},\n\t\t],\n\t},\n};\n\nexport default config;\n","import type { Linter } from 'eslint';\nimport tseslint from 'typescript-eslint';\n\nconst config: Linter.Config = {\n\tname: 'TypeScript (Linter Settings)',\n\tlanguageOptions: {\n\t\tparser: tseslint.parser,\n\t\tparserOptions: {\n\t\t\tprojectService: true,\n\t\t},\n\t},\n\tlinterOptions: {\n\t\treportUnusedDisableDirectives: 'error',\n\t\treportUnusedInlineConfigs: 'error',\n\t},\n};\n\nexport default config;\n","import type { Linter } from 'eslint';\nimport tseslint from 'typescript-eslint';\n\n/**\n * This config is intentionally limited to rules not supported by Oxlint.\n */\nconst config: Linter.Config = {\n\tname: 'TypeScript',\n\tplugins: {\n\t\t'@typescript-eslint': tseslint.plugin,\n\t},\n\trules: {\n\t\t/* oxlint-disable-next-line unicorn/no-useless-spread */\n\t\t...{\n\t\t\t'camelcase': ['error', { properties: 'always' }],\n\t\t\t'dot-notation': 'error',\n\t\t\t'func-name-matching': [\n\t\t\t\t'error',\n\t\t\t\t'never',\n\t\t\t\t{ considerPropertyDescriptor: true },\n\t\t\t],\n\t\t},\n\t\t'@typescript-eslint/consistent-type-assertions': [\n\t\t\t'error',\n\t\t\t{\n\t\t\t\tassertionStyle: 'as',\n\t\t\t\tobjectLiteralTypeAssertions: 'allow-as-parameter',\n\t\t\t},\n\t\t],\n\t\t'@typescript-eslint/consistent-type-exports': [\n\t\t\t'error',\n\t\t\t{ fixMixedExportsWithInlineTypeSpecifier: true },\n\t\t],\n\t\t'@typescript-eslint/no-unnecessary-qualifier': 'error',\n\t\t'@typescript-eslint/no-useless-default-assignment': 'error',\n\t\t'@typescript-eslint/parameter-properties': [\n\t\t\t'error',\n\t\t\t{ prefer: 'parameter-property' },\n\t\t],\n\t\t'@typescript-eslint/prefer-readonly': 'error',\n\t},\n};\n\nexport default config;\n","import type { Linter } from 'eslint';\nimport { includeIgnoreFile as _includeIgnoreFile } from '@eslint/compat';\nimport fs from 'node:fs';\nimport path from 'node:path';\n\nconst ignoreFilePath = path.resolve('.gitignore');\nconst ignoreFilePathExists = fs.existsSync(ignoreFilePath);\n\nexport default function includeIgnoreFile(\n\tconfigs: Linter.Config[]\n): Linter.Config[] {\n\treturn ignoreFilePathExists\n\t\t? [_includeIgnoreFile(ignoreFilePath, '.gitignore'), ...configs]\n\t\t: configs;\n}\n","import type { Linter } from 'eslint';\nimport configFormattingConfigFiles from '../config-formatting-config-files/index.ts';\nimport configFormatting from '../config-formatting/index.ts';\nimport configTypeScriptSettings from '../config-typescript-settings/index.ts';\nimport configTypeScript from '../config-typescript/index.ts';\nimport includeIgnoreFile from '../include-ignore-file/index.ts';\n\n/**\n * Standard Config for use in an existing config.\n */\nconst config: Linter.Config[] = includeIgnoreFile([\n\t{\n\t\tname: 'Ignored Paths',\n\t\tignores: ['**/fixtures/**'],\n\t},\n\tconfigTypeScriptSettings,\n\tconfigTypeScript,\n\tconfigFormatting,\n\t{\n\t\tfiles: ['**/*.config.*'],\n\t\t...configFormattingConfigFiles,\n\t},\n]);\n\nexport default config;\n","import { defineConfig as _defineConfig } from 'eslint/config';\nimport config from '../config/index.ts';\n\n/**\n * Combine Standard Config with optional additional config.\n */\nexport default function defineConfig(\n\t...configs: Parameters<typeof _defineConfig>\n): ReturnType<typeof _defineConfig> {\n\treturn _defineConfig(\n\t\t{\n\t\t\tname: 'Standard Config',\n\t\t\tfiles: ['**/*.{ts,tsx,cts,mts}'],\n\t\t\textends: [config],\n\t\t},\n\t\t...configs\n\t);\n}\n"],"mappings":"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"}
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@standard-config/eslint",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "TypeScript-first ESLint config designed to complement Oxlint and Prettier",
|
|
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/eslint.git"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"eslint",
|
|
17
|
+
"eslint-config",
|
|
18
|
+
"flat-config",
|
|
19
|
+
"oxc",
|
|
20
|
+
"oxlint",
|
|
21
|
+
"prettier",
|
|
22
|
+
"typescript"
|
|
23
|
+
],
|
|
24
|
+
"files": [
|
|
25
|
+
"dist/**"
|
|
26
|
+
],
|
|
27
|
+
"type": "module",
|
|
28
|
+
"sideEffects": false,
|
|
29
|
+
"exports": "./dist/index.mjs",
|
|
30
|
+
"types": "./dist/index.d.mts",
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=22"
|
|
33
|
+
},
|
|
34
|
+
"packageManager": "pnpm@10.28.1",
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@eslint/compat": "^2.0.1",
|
|
37
|
+
"eslint-plugin-perfectionist": "^5.4.0",
|
|
38
|
+
"typescript-eslint": "^8.53.1"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"eslint": ">=9"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@standard-config/prettier": "1.5.0",
|
|
45
|
+
"@standard-config/tsconfig": "2.0.0",
|
|
46
|
+
"@types/node": "^22.19.7",
|
|
47
|
+
"@vitest/coverage-v8": "4.0.18",
|
|
48
|
+
"eslint": "9.39.2",
|
|
49
|
+
"husky": "9.1.7",
|
|
50
|
+
"jiti": "^2.6.1",
|
|
51
|
+
"oxlint": "1.41.0",
|
|
52
|
+
"oxlint-tsgolint": "0.11.1",
|
|
53
|
+
"prettier": "3.8.1",
|
|
54
|
+
"publint": "0.3.17",
|
|
55
|
+
"tsdown": "0.20.1",
|
|
56
|
+
"typescript": "5.9.3",
|
|
57
|
+
"vitest": "4.0.18"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"build": "tsdown",
|
|
61
|
+
"fix": "pnpm format && pnpm lint",
|
|
62
|
+
"format": "prettier --write --ignore-unknown .",
|
|
63
|
+
"format:check": "prettier --check --ignore-unknown .",
|
|
64
|
+
"lint": "oxlint --fix --type-aware --type-check --deny-warnings --report-unused-disable-directives && eslint . --fix",
|
|
65
|
+
"lint:check": "oxlint --type-aware --type-check --deny-warnings --report-unused-disable-directives && eslint .",
|
|
66
|
+
"prepack": "pnpm run '/^(format:check|lint:check|test|typecheck)$/' && pnpm build",
|
|
67
|
+
"prepare": "husky",
|
|
68
|
+
"test": "vitest run",
|
|
69
|
+
"typecheck": "tsc --noEmit"
|
|
70
|
+
}
|
|
71
|
+
}
|