forked from iamturns/eslint-config-airbnb-typescript
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patheslint.config.mjs
36 lines (34 loc) · 1.05 KB
/
eslint.config.mjs
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
/* eslint-disable import-x/extensions */
import eslintConfigPrettier from 'eslint-config-prettier';
import airbnbTs from './base.js';
const stylisticPrettierRules = () => {
const ruleEntries = Object.entries(eslintConfigPrettier.rules);
const beginningIndex = ruleEntries.findIndex(([key]) => key === 'array-bracket-newline');
const endingIndex = ruleEntries.findIndex(([key]) => key === 'yield-star-spacing');
const formattingRuleEntries = ruleEntries.slice(beginningIndex, endingIndex + 1);
const rules = Object.fromEntries(
formattingRuleEntries.map(([key, value]) => [`@stylistic/${key}`, value]),
);
return rules;
};
export default [
{ ignores: ['node_modules/'] },
...airbnbTs,
{
languageOptions: {
ecmaVersion: 2023,
sourceType: 'module',
parserOptions: {
project: './tsconfig.json',
},
},
},
{
files: ['**/*.*js'],
rules: {
'import-x/no-unresolved': 'off', // Doesn't support imports without a "main" field
},
},
eslintConfigPrettier,
{ rules: stylisticPrettierRules() },
];