Skip to content

Commit

Permalink
chore: switch .eslintrc to flat config (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
aladdin-add committed Oct 17, 2023
1 parent e20a366 commit 5a258c2
Show file tree
Hide file tree
Showing 4 changed files with 297 additions and 224 deletions.
31 changes: 0 additions & 31 deletions .eslintrc

This file was deleted.

43 changes: 43 additions & 0 deletions eslint.config.js
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',
},
},
},
];

0 comments on commit 5a258c2

Please sign in to comment.