diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index af2353c..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "env": { - "node": true, - "es2022": true, - "mocha": true - }, - "extends": [ - "eslint:recommended", - "prettier" - ], - "plugins": [ - "prettier", - "mocha" - ], - "parserOptions": { - "sourceType": "module" - }, - "rules": { - "prettier/prettier": [ - "error" - ], - "mocha/no-skipped-tests": [ - "error" - ], - "mocha/no-exclusive-tests": [ - "error" - ], - "no-unused-vars": [ - "error", - { "args": "none" } - ] - } -} diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..1521c8b --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +dist diff --git a/eslint.config.cjs b/eslint.config.cjs new file mode 100644 index 0000000..8d4b3eb --- /dev/null +++ b/eslint.config.cjs @@ -0,0 +1,35 @@ +const globals = require("globals"); +const js = require("@eslint/js"); +const prettierConfig = require("eslint-config-prettier"); +const prettierPlugin = require("eslint-plugin-prettier"); +const mochaPlugin = require("eslint-plugin-mocha"); + +module.exports = [ + js.configs.recommended, + mochaPlugin.configs.flat.recommended, + prettierConfig, + { + ignores: ["dist"], + }, + { + plugins: { + mocha: mochaPlugin, + prettier: prettierPlugin, + }, + languageOptions: { + ecmaVersion: 2022, + sourceType: "module", + globals: { + mocha: true, + ...globals.node, + }, + }, + rules: { + "prettier/prettier": ["error"], + "mocha/no-skipped-tests": ["error"], + "mocha/no-exclusive-tests": ["error"], + "mocha/max-top-level-suites": ["off"], + "no-unused-vars": ["error", { args: "none" }], + }, + }, +]; diff --git a/package.json b/package.json index 727ac1c..f25bf4e 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,9 @@ "private": true, "scripts": { "build": "ncc build src/action.js -o dist --minify", - "lint": "eslint \"src/**/*.js\"", - "prettier": "prettier --write \"src/**/*.js\"", - "prettier:check": "prettier --check \"src/**/*.js\"", + "lint": "eslint \"**/*.{js,cjs}\"", + "prettier": "prettier dist --write \"**/*.{js,cjs}\"", + "prettier:check": "prettier --check \"**/*.{js,cjs}\"", "test": "c8 --reporter=text mocha \"src/**/*.spec.js\"", "coverage": "c8 report --reporter=cobertura" },