Skip to content

Commit

Permalink
Upgrade to eslint 9
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Jun 27, 2024
1 parent ddfecc3 commit 14aa9e2
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 19 deletions.
15 changes: 0 additions & 15 deletions .eslintrc.json

This file was deleted.

33 changes: 33 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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", "prettier"),
{
languageOptions: {
globals: {
...globals.node,
},

ecmaVersion: "latest",
sourceType: "module",
},

rules: {
"no-async-promise-executor": "warn",
"no-prototype-builtins": "warn",
"no-unused-vars": "warn",
},
},
];
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,18 @@
"@11ty/eleventy-img": "^5.0.0-beta.1",
"@11ty/eleventy-plugin-rss": "^2.0.1",
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.5.0",
"@iarna/toml": "^2.2.5",
"@mdx-js/node-loader": "^3.0.1",
"@vue/server-renderer": "^3.4.30",
"@zachleat/noop": "^1.0.3",
"ava": "^6.1.3",
"c8": "^10.1.2",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint": "^9.5.0",
"eslint-config-prettier": "^9.1.0",
"globals": "^15.6.0",
"husky": "^9.0.11",
"js-yaml": "^4.1.0",
"jsdoc": "^4.0.3",
Expand Down
3 changes: 0 additions & 3 deletions src/TemplateMap.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable indent */

import { DepGraph as DependencyGraph } from "dependency-graph";
import { isPlainObject } from "@11ty/eleventy-utils";
import debugUtil from "debug";
Expand Down Expand Up @@ -76,7 +74,6 @@ class TemplateMap {
return str.slice("collections.".length);
}
// Fixes #2851
// eslint-disable-next-line quotes
if (str.startsWith("collections['") || str.startsWith('collections["')) {
return str.slice("collections['".length, -2);
}
Expand Down

0 comments on commit 14aa9e2

Please sign in to comment.