generated from mizdra/npm-package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.js
58 lines (57 loc) · 1.61 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import mizdra from '@mizdra/eslint-config-mizdra';
/** @type {import('eslint').Linter.Config[]} */
export default [
{ ignores: ['**/dist', 'example'] },
...mizdra.baseConfigs,
...mizdra.typescriptConfigs,
...mizdra.nodeConfigs,
{
files: ['**/*.{js,jsx,mjs,cjs}', '**/*.{ts,tsx,cts,mts}'],
rules: {
'simple-import-sort/imports': [
'error',
{
// Remove blank lines between import groups
// ref: https://github.com/lydell/eslint-plugin-simple-import-sort?tab=readme-ov-file#how-do-i-use-this-with-dprint
groups: [['^\\u0000', '^node:', '^@?\\w', '^', '^\\.']],
},
],
'no-restricted-globals': [
'error',
{
name: 'Buffer',
message: 'Use Uint8Array instead.',
},
],
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'buffer',
message: 'Use Uint8Array instead.',
},
{
name: 'node:buffer',
message: 'Use Uint8Array instead.',
},
{
name: 'node:path',
message: 'Use original path package instead.',
},
],
patterns: [
{
group: ['**/src', '!**/../src'],
message: 'Do not import internal modules directly.',
},
],
},
],
// Disable because it does not work in the workspace
// ref: https://github.com/eslint-community/eslint-plugin-n/issues/209
'n/no-extraneous-import': 'off',
},
},
mizdra.prettierConfig,
];