forked from nkzw-tech/fbtee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
66 lines (65 loc) · 1.65 KB
/
.eslintrc.cjs
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
59
60
61
62
63
64
65
66
const { join } = require('node:path');
const { existsSync, readFileSync } = require('node:fs');
module.exports = {
extends: ['@nkzw'],
ignorePatterns: ['packages/*/lib', 'packages/fbtee/lib-tmp/'],
overrides: [
{
files: [
'./packages/babel-plugin-fbtee/src/bin/*.tsx',
'./packages/fbtee/babel-build.config.js',
'**/__tests__/**/*.tsx',
],
rules: {
'no-console': 0,
'workspaces/no-relative-imports': 0,
},
},
{
files: ['./.eslintrc.cjs'],
rules: {
'@typescript-eslint/no-require-imports': 0,
},
},
],
plugins: ['workspaces'],
rules: {
'@nkzw/no-instanceof': 0,
'@typescript-eslint/array-type': [2, { default: 'generic' }],
'import/no-extraneous-dependencies': [
2,
{
devDependencies: [
'./example/vite.config.ts',
'./jest-preprocessor.js',
'./packages/fbtee/babel-build.config.js',
'**/__tests__/**/*.tsx',
],
packageDir: [__dirname].concat(
readFileSync('./pnpm-workspace.yaml', 'utf8')
.split('\n')
.slice(1)
.map((n) =>
join(
__dirname,
n
.replaceAll(/\s*-\s+/g, '')
.replaceAll("'", '')
.replaceAll('\r', ''),
),
),
),
},
],
'import/no-unresolved': [
2,
{
ignore: ['@typescript-eslint/*'],
},
],
'no-extra-parens': 0,
'unicorn/prefer-dom-node-append': 0,
'workspaces/no-absolute-imports': 2,
'workspaces/no-relative-imports': 2,
},
};