Skip to content

Commit

Permalink
Update ESLint for lint npm task
Browse files Browse the repository at this point in the history
Wew update ES lint to check against ECMAScript 2020, and use the new config format
  • Loading branch information
mrchrisadams committed Nov 2, 2024
1 parent b919018 commit b3d175e
Show file tree
Hide file tree
Showing 7 changed files with 235 additions and 83 deletions.
21 changes: 0 additions & 21 deletions .eslintrc.json

This file was deleted.

40 changes: 40 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import prettier from "eslint-plugin-prettier";
import jest from "eslint-plugin-jest";
import globals from "globals";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

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

export default [
...compat.extends("eslint:recommended"),
{
plugins: {
prettier,
jest,
},

languageOptions: {
globals: {
...globals.node,
...jest.environments.globals.globals,
},

ecmaVersion: 2020,
},

rules: {
"prettier/prettier": ["error", {}],
"no-unused-vars": "off",
},
},
];
228 changes: 179 additions & 49 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b3d175e

Please sign in to comment.