forked from seek-oss/braid-design-system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
56 lines (54 loc) · 1.59 KB
/
.eslintrc.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
// eslint-disable-next-line import/no-unresolved
const yaml = require('js-yaml');
// eslint-disable-next-line import/no-unresolved
const fs = require('fs');
const workspace = yaml.load(
// eslint-disable-next-line no-sync
fs.readFileSync(`${__dirname}/pnpm-workspace.yaml`, 'utf-8'),
);
module.exports = {
extends: 'seek',
settings: {
'import/resolver': {
typescript: {
project: workspace.packages.map(
(project) => `${project}/tsconfig.json`,
),
},
},
},
// workaround for @typescript-eslint/consistent-type-imports + import/no-duplicates
// ! requires TypeScript >=4.5 downstream
// remove when this is done https://github.com/typescript-eslint/typescript-eslint/issues/4338
// plugins: ['canonical'],
rules: {
'@typescript-eslint/consistent-type-imports': 'error',
// 'canonical/prefer-inline-type-import': 'error', // remove when this is done https://github.com/typescript-eslint/typescript-eslint/issues/4338
'import/no-cycle': 'warn',
'import/no-duplicates': 'error',
'import/no-relative-packages': 'error',
},
overrides: [
{
files: ['*.{js,ts,tsx}'],
excludedFiles: [
'*.{docs,gallery,screenshots,stories}.tsx',
'site/**/*.{ts,tsx}',
],
rules: {
'no-restricted-imports': [
'error',
{
patterns: [
'braid-design-system**',
'!braid-design-system/src/lib/utils/source.macro',
'braid-src/**',
'site/**',
'**/site/**',
],
},
],
},
},
],
};