@aryaemami59/eslint-config 0.0.7 → 0.0.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.
@@ -1,9 +1,15 @@
1
- import packageJson from '../package.json' with { type: 'json' }
1
+ import packageJson from '@aryaemami59/eslint-config/package.json' with { type: 'json' }
2
2
  import { disabledRules } from './disabledRules.js'
3
- import type { Config, FlatConfig, Linter } from './external.js'
4
- import { js, prettierConfig } from './external.js'
3
+ import type { Config, ESLint, Linter, TSESLintFlatConfig } from './external.js'
4
+ import {
5
+ js,
6
+ prettierConfig,
7
+ tseslintConfigs,
8
+ tseslintParser,
9
+ tseslintPlugin,
10
+ } from './external.js'
5
11
  import { globalIgnores } from './globalIgnores.js'
6
- import { globals } from './globals.js'
12
+ import { sharedEnvironmentGlobals } from './globals.js'
7
13
 
8
14
  /**
9
15
  * Flat ESLint configuration tailored for projects using TypeScript.
@@ -55,155 +61,161 @@ export const flatESLintConfig = [
55
61
  {
56
62
  name: `${js.meta.name}/recommended`,
57
63
  ...js.configs.recommended,
58
- } as const satisfies FlatConfig.Config satisfies Config,
64
+ } as const satisfies TSESLintFlatConfig.Config satisfies Config,
59
65
 
60
66
  // TODO: You can remove the type assertion in the next major version of `typescript-eslint`.
61
67
  // TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.
62
- // ...(configs.recommended satisfies Config[] as Config<any>[]),
68
+ ...(tseslintConfigs.recommended satisfies TSESLintFlatConfig.Config[] satisfies Config[] as Config[]),
63
69
  // TODO: You can remove the type assertion in the next major version of `typescript-eslint`.
64
70
  // TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.
65
- // ...(configs.stylistic satisfies Config[] as Config<any>[]),
71
+ ...(tseslintConfigs.stylistic satisfies TSESLintFlatConfig.Config[] satisfies Config[] as Config[]),
66
72
 
67
73
  {
68
74
  languageOptions: {
69
- globals,
75
+ globals: sharedEnvironmentGlobals,
76
+ parser:
77
+ tseslintParser satisfies TSESLintFlatConfig.Parser satisfies Linter.Parser as Linter.Parser,
70
78
  parserOptions: {
71
79
  ecmaVersion: 'latest',
72
80
  projectService: true,
73
- } as const satisfies FlatConfig.ParserOptions satisfies Linter.ParserOptions,
74
- },
81
+ } as const satisfies TSESLintFlatConfig.ParserOptions satisfies Linter.ParserOptions,
82
+ } as const satisfies TSESLintFlatConfig.LanguageOptions satisfies Linter.LanguageOptions,
75
83
  linterOptions: {
76
84
  reportUnusedDisableDirectives: 2,
77
85
  reportUnusedInlineConfigs: 2,
78
86
  },
79
87
  name: `${packageJson.name}/defaults/overrides`,
88
+ plugins: {
89
+ '@typescript-eslint':
90
+ tseslintPlugin satisfies TSESLintFlatConfig.Plugin satisfies ESLint.Plugin as ESLint.Plugin,
91
+ },
80
92
 
81
93
  rules: {
82
94
  // TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.
83
- // '@typescript-eslint/consistent-type-definitions': [2, 'type'],
84
- // '@typescript-eslint/consistent-type-exports': [
85
- // 2,
86
- // { fixMixedExportsWithInlineTypeSpecifier: false },
87
- // ],
88
- // '@typescript-eslint/consistent-type-imports': [
89
- // 2,
90
- // {
91
- // disallowTypeAnnotations: true,
92
- // fixStyle: 'separate-type-imports',
93
- // prefer: 'type-imports',
94
- // },
95
- // ],
96
- // '@typescript-eslint/no-confusing-void-expression': [
97
- // 2,
98
- // {
99
- // ignoreArrowShorthand: false,
100
- // ignoreVoidOperator: false,
101
- // ignoreVoidReturningFunctions: false,
102
- // },
103
- // ],
104
- // '@typescript-eslint/no-duplicate-type-constituents': [
105
- // 2,
106
- // {
107
- // ignoreIntersections: false,
108
- // ignoreUnions: false,
109
- // },
110
- // ],
111
- // '@typescript-eslint/no-empty-object-type': [
112
- // 2,
113
- // {
114
- // allowInterfaces: 'never',
115
- // allowObjectTypes: 'never',
116
- // },
117
- // ],
118
- // '@typescript-eslint/no-explicit-any': [
119
- // 2,
120
- // {
121
- // fixToUnknown: false,
122
- // ignoreRestArgs: false,
123
- // },
124
- // ],
125
- // '@typescript-eslint/no-inferrable-types': [
126
- // 2,
127
- // {
128
- // ignoreParameters: false,
129
- // ignoreProperties: false,
130
- // },
131
- // ],
132
- // '@typescript-eslint/no-invalid-void-type': [
133
- // 2,
134
- // {
135
- // allowAsThisParameter: false,
136
- // allowInGenericTypeArguments: true,
137
- // },
138
- // ],
139
- // '@typescript-eslint/no-namespace': [
140
- // 2,
141
- // {
142
- // allowDeclarations: false,
143
- // allowDefinitionFiles: true,
144
- // },
145
- // ],
146
- // '@typescript-eslint/no-redundant-type-constituents': [2],
147
- // '@typescript-eslint/no-require-imports': [
148
- // 2,
149
- // {
150
- // allow: [],
151
- // allowAsImport: true,
152
- // },
153
- // ],
154
- // '@typescript-eslint/no-restricted-types': [
155
- // 2,
156
- // {
157
- // types: {
158
- // '{}': {
159
- // message: `
160
- // - If you want to represent an empty object, use \`type EmptyObject = Record<string, never>\`.
161
- // - If you want to represent an object literal, use either \`type AnyObject = Record<string, any>\` or \`object\`.
162
- // - If you want to represent any non-nullish value, use \`type AnyNonNullishValue = NonNullable<unknown>\`.`,
163
- // suggest: [
164
- // 'AnyNonNullishValue',
165
- // 'EmptyObject',
166
- // 'AnyObject',
167
- // 'object',
168
- // 'Record<string, never>',
169
- // 'Record<string, any>',
170
- // 'NonNullable<unknown>',
171
- // ],
172
- // },
173
- // },
174
- // },
175
- // ],
176
- // '@typescript-eslint/no-unnecessary-type-arguments': [2],
177
- // '@typescript-eslint/no-unnecessary-type-assertion': [
178
- // 2,
179
- // { typesToIgnore: [] },
180
- // ],
181
- // '@typescript-eslint/no-unnecessary-type-parameters': [2],
182
- // '@typescript-eslint/prefer-nullish-coalescing': [
183
- // 2,
184
- // {
185
- // allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
186
- // ignoreBooleanCoercion: false,
187
- // ignoreConditionalTests: true,
188
- // ignoreIfStatements: false,
189
- // ignoreMixedLogicalExpressions: false,
190
- // ignorePrimitives: {
191
- // bigint: false,
192
- // boolean: false,
193
- // number: false,
194
- // string: false,
195
- // },
196
- // ignoreTernaryTests: false,
197
- // },
198
- // ],
199
- // '@typescript-eslint/require-await': [2],
200
- // '@typescript-eslint/unified-signatures': [
201
- // 2,
202
- // {
203
- // ignoreDifferentlyNamedParameters: false,
204
- // ignoreOverloadsWithDifferentJSDoc: false,
205
- // },
206
- // ],
95
+ '@typescript-eslint/consistent-type-definitions': [2, 'type'],
96
+ '@typescript-eslint/consistent-type-exports': [
97
+ 2,
98
+ { fixMixedExportsWithInlineTypeSpecifier: false },
99
+ ],
100
+ '@typescript-eslint/consistent-type-imports': [
101
+ 2,
102
+ {
103
+ disallowTypeAnnotations: true,
104
+ fixStyle: 'separate-type-imports',
105
+ prefer: 'type-imports',
106
+ },
107
+ ],
108
+ '@typescript-eslint/no-confusing-void-expression': [
109
+ 2,
110
+ {
111
+ ignoreArrowShorthand: false,
112
+ ignoreVoidOperator: false,
113
+ ignoreVoidReturningFunctions: false,
114
+ },
115
+ ],
116
+ '@typescript-eslint/no-duplicate-type-constituents': [
117
+ 2,
118
+ {
119
+ ignoreIntersections: false,
120
+ ignoreUnions: false,
121
+ },
122
+ ],
123
+ '@typescript-eslint/no-empty-object-type': [
124
+ 2,
125
+ {
126
+ allowInterfaces: 'never',
127
+ allowObjectTypes: 'never',
128
+ },
129
+ ],
130
+ '@typescript-eslint/no-explicit-any': [
131
+ 2,
132
+ {
133
+ fixToUnknown: false,
134
+ ignoreRestArgs: false,
135
+ },
136
+ ],
137
+ '@typescript-eslint/no-inferrable-types': [
138
+ 2,
139
+ {
140
+ ignoreParameters: false,
141
+ ignoreProperties: false,
142
+ },
143
+ ],
144
+ '@typescript-eslint/no-invalid-void-type': [
145
+ 2,
146
+ {
147
+ allowAsThisParameter: false,
148
+ allowInGenericTypeArguments: true,
149
+ },
150
+ ],
151
+ '@typescript-eslint/no-namespace': [
152
+ 2,
153
+ {
154
+ allowDeclarations: false,
155
+ allowDefinitionFiles: true,
156
+ },
157
+ ],
158
+ '@typescript-eslint/no-redundant-type-constituents': [2],
159
+ '@typescript-eslint/no-require-imports': [
160
+ 2,
161
+ {
162
+ allow: [],
163
+ allowAsImport: true,
164
+ },
165
+ ],
166
+ '@typescript-eslint/no-restricted-types': [
167
+ 2,
168
+ {
169
+ types: {
170
+ '{}': {
171
+ message: `
172
+ - If you want to represent an empty object, use \`type EmptyObject = Record<string, never>\`.
173
+ - If you want to represent an object literal, use either \`type AnyObject = Record<string, any>\` or \`object\`.
174
+ - If you want to represent any non-nullish value, use \`type AnyNonNullishValue = NonNullable<unknown>\`.`,
175
+ suggest: [
176
+ 'AnyNonNullishValue',
177
+ 'EmptyObject',
178
+ 'AnyObject',
179
+ 'object',
180
+ 'Record<string, never>',
181
+ 'Record<string, any>',
182
+ 'NonNullable<unknown>',
183
+ ],
184
+ },
185
+ },
186
+ },
187
+ ],
188
+ '@typescript-eslint/no-unnecessary-type-arguments': [2],
189
+ '@typescript-eslint/no-unnecessary-type-assertion': [
190
+ 2,
191
+ { typesToIgnore: [] },
192
+ ],
193
+ '@typescript-eslint/no-unnecessary-type-parameters': [2],
194
+ '@typescript-eslint/prefer-nullish-coalescing': [
195
+ 2,
196
+ {
197
+ allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
198
+ ignoreBooleanCoercion: false,
199
+ ignoreConditionalTests: true,
200
+ ignoreIfStatements: false,
201
+ ignoreMixedLogicalExpressions: false,
202
+ ignorePrimitives: {
203
+ bigint: false,
204
+ boolean: false,
205
+ number: false,
206
+ string: false,
207
+ },
208
+ ignoreTernaryTests: false,
209
+ },
210
+ ],
211
+ '@typescript-eslint/require-await': [2],
212
+ '@typescript-eslint/unified-signatures': [
213
+ 2,
214
+ {
215
+ ignoreDifferentlyNamedParameters: false,
216
+ ignoreOverloadsWithDifferentJSDoc: false,
217
+ },
218
+ ],
207
219
  'object-shorthand': [
208
220
  2,
209
221
  'always',
@@ -233,7 +245,7 @@ export const flatESLintConfig = [
233
245
  files: ['**/*.cjs'],
234
246
  languageOptions: {
235
247
  sourceType: 'commonjs',
236
- } as const satisfies FlatConfig.LanguageOptions satisfies Linter.LanguageOptions,
248
+ } as const satisfies TSESLintFlatConfig.LanguageOptions satisfies Linter.LanguageOptions,
237
249
  name: `${packageJson.name}/commonjs-files`,
238
250
  rules: {
239
251
  '@typescript-eslint/no-require-imports': [