Skip to content

Commit 327c639

Browse files
authored
Merge branch 'next' into infra/github/merge_queue
2 parents 228c24e + df87d60 commit 327c639

File tree

3 files changed

+41
-5
lines changed

3 files changed

+41
-5
lines changed

eslint.config.ts

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { includeIgnoreFile } from '@eslint/compat';
22
import eslint from '@eslint/js';
33
import stylistic from '@stylistic/eslint-plugin';
44
import eslintPluginVitest from '@vitest/eslint-plugin';
5+
import eslintPluginFileProgress from 'eslint-plugin-file-progress';
56
import eslintPluginJsdoc from 'eslint-plugin-jsdoc';
67
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
78
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
@@ -17,6 +18,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
1718
//#region global
1819
includeIgnoreFile(gitignorePath),
1920
{
21+
name: 'manual ignores',
2022
ignores: [
2123
// Skip some files that don't need linting right now
2224
'.github/workflows/commentCodeGeneration.ts',
@@ -28,6 +30,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
2830
],
2931
},
3032
{
33+
name: 'linter options',
3134
linterOptions: {
3235
reportUnusedDisableDirectives: 'error',
3336
},
@@ -37,6 +40,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
3740
//#region eslint (js)
3841
eslint.configs.recommended,
3942
{
43+
name: 'eslint overrides',
4044
rules: {
4145
eqeqeq: ['error', 'always', { null: 'ignore' }],
4246
'logical-assignment-operators': 'error',
@@ -51,9 +55,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
5155
//#region typescript-eslint
5256
...tseslint.configs.strictTypeChecked,
5357
{
54-
plugins: {
55-
'@typescript-eslint': tseslint.plugin,
56-
},
58+
name: 'typescript-eslint overrides',
5759
languageOptions: {
5860
parserOptions: {
5961
project: true,
@@ -128,6 +130,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
128130

129131
//#region stylistic
130132
{
133+
name: 'stylistic overrides',
131134
plugins: {
132135
'@stylistic': stylistic,
133136
},
@@ -143,6 +146,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
143146
//#region unicorn
144147
eslintPluginUnicorn.configs['flat/recommended'],
145148
{
149+
name: 'unicorn overrides',
146150
rules: {
147151
'unicorn/import-style': 'off', // subjective & doesn't do anything for us
148152
'unicorn/no-array-callback-reference': 'off', // reduces readability
@@ -153,13 +157,13 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
153157
'unicorn/number-literal-case': 'off', // incompatible with prettier
154158
'unicorn/numeric-separators-style': 'off', // "magic numbers" may carry specific meaning
155159
'unicorn/prefer-string-raw': 'off', // The additional prefix doesn't help readability
160+
'unicorn/prefer-string-slice': 'off', // string.substring is sometimes easier to use
156161
'unicorn/prefer-ternary': 'off', // ternaries aren't always better
157162

158163
// TODO @Shinigami92 2023-09-23: The following rules currently conflict with our code.
159164
// Each rule should be checked whether it should be enabled/configured and the problems fixed, or stay disabled permanently.
160165
'unicorn/consistent-function-scoping': 'off',
161166
'unicorn/prefer-export-from': 'off',
162-
'unicorn/prefer-string-slice': 'off',
163167
'unicorn/prevent-abbreviations': 'off',
164168
},
165169
},
@@ -168,6 +172,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
168172
//#region jsdoc
169173
eslintPluginJsdoc.configs['flat/recommended-typescript-error'],
170174
{
175+
name: 'jsdoc overrides',
171176
rules: {
172177
'jsdoc/require-jsdoc': 'off', // Enabled only for src/**/*.ts
173178
'jsdoc/require-returns': 'off',
@@ -200,10 +205,15 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
200205

201206
//#region prettier
202207
eslintPluginPrettierRecommended,
203-
//#endregion,
208+
//#endregion
209+
210+
//#region file-progress
211+
eslintPluginFileProgress.configs.recommended,
212+
//#endregion
204213

205214
//#region overrides
206215
{
216+
name: 'src/**/*.ts overrides',
207217
files: ['src/**/*.ts'],
208218
rules: {
209219
'no-undef': 'error', // Must override the config from typescript-eslint
@@ -215,12 +225,14 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
215225
},
216226
},
217227
{
228+
name: 'src/locale/**/*.ts overrides',
218229
files: ['src/locale/**/*.ts'],
219230
rules: {
220231
'unicorn/filename-case': 'off', // our locale files have a custom naming scheme
221232
},
222233
},
223234
{
235+
name: 'src/{definitions,locales}/**/*.ts overrides',
224236
files: ['src/definitions/**/*.ts', 'src/locales/**/*.ts'],
225237
rules: {
226238
'unicorn/filename-case': [
@@ -233,6 +245,7 @@ const config: ReturnType<typeof tseslint.config> = tseslint.config(
233245
},
234246
},
235247
{
248+
name: 'test/**/*.ts overrides',
236249
files: ['test/**/*.spec.ts', 'test/**/*.spec.d.ts'],
237250
plugins: {
238251
vitest: eslintPluginVitest,

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
"cypress": "13.15.1",
121121
"eslint": "9.14.0",
122122
"eslint-config-prettier": "9.1.0",
123+
"eslint-plugin-file-progress": "2.1.1",
123124
"eslint-plugin-jsdoc": "50.4.3",
124125
"eslint-plugin-prettier": "5.2.1",
125126
"eslint-plugin-unicorn": "56.0.0",

pnpm-lock.yaml

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)