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 648f54d commit e492b73
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 32 deletions.
29 changes: 0 additions & 29 deletions .eslintrc.json

This file was deleted.

30 changes: 30 additions & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
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,
{
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"],
},
},
];
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"description": "A command-line JSON and YAML validator that's on your wavelength",
"scripts": {
"test": "V8R_CACHE_NAME=v8r-test c8 --reporter=text mocha \"src/**/*.spec.js\"",
"lint": "eslint \"src/**/*.js\"",
"lint": "eslint \"**/*.{js,cjs}\"",
"coverage": "c8 report --reporter=cobertura",
"prettier": "prettier --write \"**/*.js\"",
"prettier:check": "prettier --check \"**/*.js\"",
"prettier": "prettier --write \"**/*.{js,cjs}\"",
"prettier:check": "prettier --check \"**/*.{js,cjs}\"",
"v8r": "src/index.js"
},
"bin": {
Expand Down

0 comments on commit e492b73

Please sign in to comment.