Skip to content

Commit 5a258c2

Browse files
authored
chore: switch .eslintrc to flat config (#128)
1 parent e20a366 commit 5a258c2

File tree

4 files changed

+297
-224
lines changed

4 files changed

+297
-224
lines changed

.eslintrc

Lines changed: 0 additions & 31 deletions
This file was deleted.

eslint.config.js

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
'use strict';
2+
3+
const jsPlugin = require('@eslint/js');
4+
const prettierConfig = require('eslint-config-prettier');
5+
const eslintPluginRecommendedConfig = require('eslint-plugin-eslint-plugin/configs/recommended');
6+
7+
const eslintPluginConfigs = [
8+
eslintPluginRecommendedConfig,
9+
{
10+
rules: {
11+
'eslint-plugin/prefer-message-ids': 'off', // TODO: enable
12+
'eslint-plugin/require-meta-docs-description': ['error', { pattern: '^(Detects|Enforces|Requires|Disallows) .+\\.$' }],
13+
'eslint-plugin/require-meta-docs-url': [
14+
'error',
15+
{
16+
pattern: 'https://github.com/eslint-community/eslint-plugin-security/blob/main/docs/rules/{{name}}.md',
17+
},
18+
],
19+
'eslint-plugin/require-meta-schema': 'off', // TODO: enable
20+
'eslint-plugin/require-meta-type': 'off', // TODO: enable
21+
},
22+
},
23+
];
24+
25+
module.exports = [
26+
jsPlugin.configs.recommended,
27+
prettierConfig,
28+
...eslintPluginConfigs,
29+
{
30+
languageOptions: {
31+
sourceType: 'commonjs',
32+
},
33+
},
34+
{
35+
files: ['test/**/*.js'],
36+
languageOptions: {
37+
globals: {
38+
describe: 'readonly',
39+
it: 'readonly',
40+
},
41+
},
42+
},
43+
];

0 commit comments

Comments
 (0)