Skip to content

Commit 27668fb

Browse files
committed
fix: comma dangle
1 parent ea4916a commit 27668fb

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

eslint.config.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,17 @@ addRule('neostandard/base', 'import/order', [
100100
}
101101
])
102102

103+
addRule('neostandard/style/modernization-since-standard-17', '@stylistic/comma-dangle', [
104+
'error',
105+
{
106+
arrays: 'never',
107+
objects: 'never',
108+
imports: 'never',
109+
exports: 'never',
110+
functions: 'never'
111+
}
112+
])
113+
103114
setParser('neostandard/ts', eslintParser, {
104115
projectService: true,
105116
sourceType: 'module',
@@ -110,13 +121,14 @@ setParser('neostandard/ts', eslintParser, {
110121
// addPlugin('neostandard/ts', 'etc', etc)
111122
// addRule('neostandard/ts', 'etc/prefer-interface', 'error') // https://ncjamieson.com/prefer-interfaces/
112123

124+
addRule('neostandard/ts', 'no-return-await', 'off') // disable this rule to use @typescript-eslint/return-await instead
113125
addRule('neostandard/ts', '@typescript-eslint/no-use-before-define', [
114126
'error', {
115127
functions: false,
116128
classes: false,
117129
enums: false,
118130
variables: false,
119-
typedefs: false,
131+
typedefs: false
120132
}
121133
]) // Types often are recursive & no use before define is too restrictive
122134
addRule('neostandard/ts', '@typescript-eslint/prefer-function-type', 'off') // conflicts with 'etc/prefer-interface'
@@ -134,12 +146,11 @@ addRule('neostandard/ts', '@typescript-eslint/restrict-template-expressions', 'o
134146
addRule('neostandard/ts', '@typescript-eslint/method-signature-style', ['error', 'method']) // enforce method signature style
135147
addRule('neostandard/ts', '@typescript-eslint/no-unsafe-argument', 'off') // allow passing args with `any` type to functions
136148
addRule('neostandard/ts', '@typescript-eslint/unbound-method', 'off') // allow invoking functions that may be unbound (e.g. passed as part of an options object)
137-
addRule('neostandard/ts', 'no-return-await', 'off') // disable this rule to use @typescript-eslint/return-await instead
138149
addRule('neostandard/ts', '@typescript-eslint/return-await', ['error', 'in-try-catch']) // require awaiting thenables returned from try/catch
150+
addRule('neostandard/ts', '@typescript-eslint/only-throw-error', 'error') // only throw Error objects
139151
addRule('neostandard/ts', 'jsdoc/require-param', 'off') // do not require jsdoc for params
140152
addRule('neostandard/ts', 'jsdoc/require-param-type', 'off') // allow compiler to derive param type
141153
addRule('neostandard/ts', 'import/consistent-type-specifier-style', ['error', 'prefer-top-level']) // prefer `import type { Foo }` over `import { type Foo }`
142-
addRule('neostandard/ts', '@typescript-eslint/only-throw-error', 'error') // only throw Error objects
143154

144155
const jsdocSettings = {
145156
mode: 'typescript',
@@ -203,7 +214,7 @@ const jsdocConfig = {
203214
// parse various forms correctly. For now warn on invalid type from,
204215
// should revisit once following issue is fixed:
205216
// https://github.com/jsdoctypeparser/jsdoctypeparser/issues/50
206-
'jsdoc/valid-types': 'off',
217+
'jsdoc/valid-types': 'off'
207218
}
208219
}
209220

@@ -219,7 +230,7 @@ const jsdocTsConfig = {
219230
},
220231
rules: {
221232
'jsdoc/require-param': 'off', // do not require jsdoc for params
222-
'jsdoc/require-param-type': 'off', // allow compiler to derive param type
233+
'jsdoc/require-param-type': 'off' // allow compiler to derive param type
223234
}
224235
}
225236

0 commit comments

Comments
 (0)