Skip to content

Commit

Permalink
switch to flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
chris48s committed May 13, 2024
1 parent 3d90eca commit 472a93d
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 36 deletions.
33 changes: 0 additions & 33 deletions .eslintrc.json

This file was deleted.

1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
35 changes: 35 additions & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -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" }],
},
},
];
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down

0 comments on commit 472a93d

Please sign in to comment.