generated from mizdra/npm-package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
33 lines (32 loc) · 1.31 KB
/
eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import mizdra from '@mizdra/eslint-config-mizdra';
import tsdoc from 'eslint-plugin-tsdoc';
/** @type {import('eslint').Linter.Config[]} */
export default [
{ ignores: ['**/dist'] },
{ plugins: { tsdoc } },
...mizdra.baseConfigs,
...mizdra.typescriptConfigs,
...mizdra.nodeConfigs,
{
files: ['**/*.{ts,tsx,cts,mts}', '**/*.{js,jsx,cjs,mjs}'],
rules: {
'simple-import-sort/imports': ['error', { groups: [['^\\u0000', '^node:', '^@?\\w', '^', '^\\.']] }],
'n/no-unsupported-features/es-syntax': 'off', // temporary
'n/no-unsupported-features/node-builtins': 'off', // temporary
},
},
{
files: ['**/*.{ts,tsx,cts,mts}'],
rules: {
'tsdoc/syntax': 'error',
// In tsdoc, if you define a method type in a property style, it will not be determined as a method.
// Therefore, it forces methods to be defined in method shorthand syntax.
'@typescript-eslint/method-signature-style': ['error', 'method'],
// In tsdoc, properties of a type defined with `interface` are included in the document,
// whereas those defined with `type` are omitted from the document.
// So we force types to be defined with `interface` whenever possible.
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
},
},
mizdra.prettierConfig,
];