From c644fec5ba48bbfa2095d76fc8219126591f1ecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=AF=E7=84=B6?= Date: Mon, 15 May 2023 10:22:32 +0800 Subject: [PATCH] chore: update eslint.config.js --- README.md | 2 +- eslint.config.js | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 96eef22a..8910e8bb 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,7 @@ These preset configs: - A: See [context.getFilename() in rule returns relative path](https://github.com/roadhump/SublimeLinter-eslint#contextgetfilename-in-rule-returns-relative-path) in the SublimeLinter-eslint FAQ. - Q: How to use the new eslint config with mixed commonjs and es modules? -- A: The `recommended` config is no longer exported. You can create a config based on `recommended-script` and `recommended-module`. +- A: The `recommended` config is no longer exported. You can create a config based on `recommended-script` and `recommended-module`. An example: ```js const nodeRecommendedScript = require("eslint-plugin-n/configs/recommended-script"); diff --git a/eslint.config.js b/eslint.config.js index dfd58673..7e50e9a2 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -18,8 +18,24 @@ module.exports = [ languageOptions: { globals: globals.mocha }, linterOptions: { reportUnusedDisableDirectives: true }, }, - { ignores: [".nyc_output/", "coverage/", "docs/", "lib/converted-esm/"] }, + { + ignores: [ + ".nyc_output/", + "coverage/", + "docs/", + "lib/converted-esm/", + "test/fixtures/", + ], + }, js.configs.recommended, nodeRecommended, ...compat.extends("plugin:eslint-plugin/recommended", "prettier"), + { rules: { "eslint-plugin/require-meta-docs-description": "error" } }, + { + // these messageIds were used outside + files: ["lib/rules/prefer-global/*.js"], + rules: { + "eslint-plugin/no-unused-message-ids": 0, + }, + }, ]