Skip to content

Commit

Permalink
feat: migrate eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
jnoortheen committed Aug 2, 2024
1 parent 7a21af2 commit 5fd26eb
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 22 deletions.
20 changes: 0 additions & 20 deletions .eslintrc.json

This file was deleted.

43 changes: 43 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";
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",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"prettier",
),
{
plugins: {
"@typescript-eslint": typescriptEslint,
},

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

parser: tsParser,
ecmaVersion: 5,
sourceType: "module",

parserOptions: {
project: "tsconfig.json",
},
},
},
];
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@
"devDependencies": {
"@commitlint/cli": "*",
"@commitlint/config-conventional": "*",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.8.0",
"@types/command-exists": "^1.2.0",
"@types/node": "*",
"@types/vscode": "*",
Expand All @@ -122,6 +124,7 @@
"esbuild": "^0.23.0",
"eslint": "*",
"eslint-config-prettier": "*",
"globals": "^15.9.0",
"husky": "^9.1.4",
"js-yaml": "^4.0.0",
"ovsx": "^0.9",
Expand All @@ -136,7 +139,7 @@
"build-base": "esbuild ./src/extension.ts --bundle --outfile=dist/extension.js --external:vscode --format=cjs --platform=node",
"build": "yarn run build-base --sourcemap --minify",
"watch": "yarn run build-base --sourcemap --watch",
"postinstall": "husky install",
"postinstall": "husky",
"clean": "del dist",
"prerelease": "yarn install && yarn lint && yarn clean && yarn build",
"release": "standard-version",
Expand Down
7 changes: 6 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@
minimatch "^3.1.2"
strip-json-comments "^3.1.1"

"@eslint/[email protected]":
"@eslint/[email protected]", "@eslint/js@^9.8.0":
version "9.8.0"
resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.8.0.tgz#ae9bc14bb839713c5056f5018bcefa955556d3a4"
integrity sha512-MfluB7EUfxXtv3i/++oh89uzAr4PDI4nn201hsp+qaXqsjAWzinlZEHEfPgAX4doIlKvPG/i0A9dpKxOLII8yA==
Expand Down Expand Up @@ -2069,6 +2069,11 @@ globals@^14.0.0:
resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e"
integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==

globals@^15.9.0:
version "15.9.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-15.9.0.tgz#e9de01771091ffbc37db5714dab484f9f69ff399"
integrity sha512-SmSKyLLKFbSr6rptvP8izbyxJL4ILwqO9Jg23UA0sDlGlu58V59D1//I3vlc0KJphVdUR7vMjHIplYnzBxorQA==

globby@^11.1.0:
version "11.1.0"
resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b"
Expand Down

0 comments on commit 5fd26eb

Please sign in to comment.