|
1 | 1 | "use strict"; |
2 | 2 |
|
3 | 3 | const js = require("@eslint/js"); |
4 | | -const { FlatCompat } = require("@eslint/eslintrc"); |
| 4 | +const eslintPluginEslintComments = require("@eslint-community/eslint-plugin-eslint-comments/configs"); |
5 | 5 | const eslintPluginEslintPluginAll = require("eslint-plugin-eslint-plugin/configs/all"); |
6 | 6 | const eslintPluginMarkdown = require("eslint-plugin-markdown"); |
| 7 | +const eslintPluginMocha = require("eslint-plugin-mocha"); |
| 8 | +const eslintPluginN = require("eslint-plugin-n"); |
| 9 | +const eslintPluginPrettierRecommended = require("eslint-plugin-prettier/recommended"); |
| 10 | +const eslintPluginUnicorn = require("eslint-plugin-unicorn"); |
7 | 11 | const globals = require("globals"); |
8 | 12 |
|
9 | | -const compat = new FlatCompat({ |
10 | | - baseDirectory: __dirname, |
11 | | - recommendedConfig: js.configs.recommended, |
12 | | -}); |
13 | | - |
14 | 13 | module.exports = [ |
15 | | - ...compat.extends( |
16 | | - "plugin:eslint-comments/recommended", |
17 | | - "plugin:node/recommended", |
18 | | - "plugin:prettier/recommended", |
19 | | - "plugin:unicorn/recommended", |
20 | | - ), |
| 14 | + js.configs.recommended, |
21 | 15 |
|
| 16 | + eslintPluginEslintComments.recommended, |
22 | 17 | eslintPluginEslintPluginAll, |
| 18 | + eslintPluginN.configs["flat/recommended"], |
| 19 | + eslintPluginPrettierRecommended, |
| 20 | + eslintPluginUnicorn.configs["flat/recommended"], |
23 | 21 |
|
24 | | - // Apply mocha config only to tests. |
25 | | - ...compat |
26 | | - .extends("plugin:mocha/recommended") |
27 | | - .map((config) => ({ ...config, files: ["tests/**/*.js"] })), |
| 22 | + { |
| 23 | + ...eslintPluginMocha.configs.flat.recommended, |
| 24 | + files: ["tests/**/*.js"], |
| 25 | + }, |
28 | 26 |
|
29 | 27 | { |
30 | 28 | languageOptions: { |
@@ -136,14 +134,6 @@ module.exports = [ |
136 | 134 | "spaced-comment": ["error", "always", { exceptions: ["-"] }], |
137 | 135 | strict: ["error", "global"], |
138 | 136 | "use-isnan": "error", |
139 | | - "valid-jsdoc": [ |
140 | | - "error", |
141 | | - { |
142 | | - prefer: { |
143 | | - return: "returns", |
144 | | - }, |
145 | | - }, |
146 | | - ], |
147 | 137 | "valid-typeof": "error", |
148 | 138 | yoda: ["error", "never"], |
149 | 139 |
|
@@ -172,8 +162,8 @@ module.exports = [ |
172 | 162 | ], |
173 | 163 | "eslint-plugin/require-meta-schema-description": "off", // TODO: enable this. |
174 | 164 |
|
175 | | - // eslint-plugin-node |
176 | | - "node/no-missing-require": [ |
| 165 | + // eslint-plugin-n |
| 166 | + "n/no-missing-require": [ |
177 | 167 | "error", |
178 | 168 | { |
179 | 169 | allowModules: ["@typescript-eslint/parser"], |
@@ -207,11 +197,6 @@ module.exports = [ |
207 | 197 | { |
208 | 198 | // Markdown code samples. |
209 | 199 | files: ["**/*.md/*.js", "**/*.md/*.javascript"], |
210 | | - languageOptions: { |
211 | | - parserOptions: { |
212 | | - sourceType: "module", |
213 | | - }, |
214 | | - }, |
215 | 200 | rules: { |
216 | 201 | eqeqeq: "off", |
217 | 202 | "guard-for-in": "off", |
|
0 commit comments