Skip to content

Commit

Permalink
Upgrade eslint to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Nov 16, 2024
1 parent 24305ac commit de5fc4d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
27 changes: 27 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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"), {
languageOptions: {
globals: {
...globals.node,
},
},

rules: {
indent: ["error", 2],
"linebreak-style": ["error", "unix"],
semi: ["error", "always"],
},
}];
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"node": ">=18"
},
"scripts": {
"pretest": "eslint img.js test/**.js",
"pretest": "eslint img.js src/**.js test/**.js",
"test": "ava --no-worker-threads",
"sample": "cd sample && node sample.js"
},
Expand Down Expand Up @@ -49,8 +49,11 @@
"devDependencies": {
"@11ty/eleventy": "^3.0.0",
"@11ty/eleventy-plugin-webc": "^0.11.2",
"ava": "^6.1.3",
"eslint": "^8.56.0",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.15.0",
"ava": "^6.2.0",
"eslint": "^9.15.0",
"globals": "^15.12.0",
"pixelmatch": "^5.3.0"
},
"ava": {
Expand Down

0 comments on commit de5fc4d

Please sign in to comment.