-
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: switch .eslintrc to flat config (#128)
- Loading branch information
1 parent
e20a366
commit 5a258c2
Showing
4 changed files
with
297 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
'use strict'; | ||
|
||
const jsPlugin = require('@eslint/js'); | ||
const prettierConfig = require('eslint-config-prettier'); | ||
const eslintPluginRecommendedConfig = require('eslint-plugin-eslint-plugin/configs/recommended'); | ||
|
||
const eslintPluginConfigs = [ | ||
eslintPluginRecommendedConfig, | ||
{ | ||
rules: { | ||
'eslint-plugin/prefer-message-ids': 'off', // TODO: enable | ||
'eslint-plugin/require-meta-docs-description': ['error', { pattern: '^(Detects|Enforces|Requires|Disallows) .+\\.$' }], | ||
'eslint-plugin/require-meta-docs-url': [ | ||
'error', | ||
{ | ||
pattern: 'https://github.com/eslint-community/eslint-plugin-security/blob/main/docs/rules/{{name}}.md', | ||
}, | ||
], | ||
'eslint-plugin/require-meta-schema': 'off', // TODO: enable | ||
'eslint-plugin/require-meta-type': 'off', // TODO: enable | ||
}, | ||
}, | ||
]; | ||
|
||
module.exports = [ | ||
jsPlugin.configs.recommended, | ||
prettierConfig, | ||
...eslintPluginConfigs, | ||
{ | ||
languageOptions: { | ||
sourceType: 'commonjs', | ||
}, | ||
}, | ||
{ | ||
files: ['test/**/*.js'], | ||
languageOptions: { | ||
globals: { | ||
describe: 'readonly', | ||
it: 'readonly', | ||
}, | ||
}, | ||
}, | ||
]; |
Oops, something went wrong.