Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: dogfooding the new config
  • Loading branch information
aladdin-add committed May 15, 2023
commit dea40ad3a1a11d90741f976523ba860cda4f9c1c
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/**
* @author Toru Nagashima
* @deprecated
* @description the file is no longer used, and will be removed in the future.
* See LICENSE file in root directory for full license.
*/
"use strict"
Expand Down
2 changes: 1 addition & 1 deletion configs/recommended-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ const { configs, rules } = require("../lib/index.js")

module.exports = {
plugins: { n: { rules } },
languageOptions: { sourceType: "script" },
languageOptions: { sourceType: "commonjs" },
rules: configs["recommended-script"].rules,
}
27 changes: 27 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* @author 唯然<[email protected]>
*/
"use strict"

const js = require("@eslint/js")
const { FlatCompat } = require("@eslint/eslintrc")
const globals = require("globals")
const nodeRecommended = require("eslint-plugin-n/configs/recommended-script")

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
})

module.exports = [
...compat.extends(
"eslint:recommended",
"plugin:eslint-plugin/recommended",
"prettier"
),
nodeRecommended,
{
languageOptions: { globals: globals.mocha },
linterOptions: { reportUnusedDisableDirectives: true },
},
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compared to the previous (.eslintrc.js) config, this one might be missing this rule:

rules: {
"eslint-plugin/require-meta-docs-description": "error",
},

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,18 @@
"eslint": ">=7.0.0"
},
"dependencies": {
"@eslint-community/eslint-utils": "^4.4.0",
"builtins": "^5.0.1",
"eslint-plugin-es-x": "^6.1.0",
"@eslint-community/eslint-utils": "^4.4.0",
"ignore": "^5.1.1",
"is-core-module": "^2.12.0",
"minimatch": "^3.1.2",
"resolve": "^1.22.2",
"semver": "^7.5.0"
},
"devDependencies": {
"@eslint/eslintrc": "^2.0.2",
"@eslint/js": "^8.38.0",
"@typescript-eslint/parser": "^5.59.0",
"codecov": "^3.3.0",
"esbuild": "^0.17.17",
Expand Down