Skip to content

Commit

Permalink
Migrate ESLint to flat config
Browse files Browse the repository at this point in the history
  • Loading branch information
tlinhart committed Jun 29, 2024
1 parent 0bd4f59 commit 9bb7f4e
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 19 deletions.
14 changes: 0 additions & 14 deletions .eslintrc

This file was deleted.

1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
.eslintrc linguist-language=JSON
.prettierrc linguist-language=JSON
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Check formatting with Prettier
run: npx prettier --check --ignore-unknown "**/*"
- name: Lint with ESLint
run: npx eslint . --ext .ts
run: npx eslint "**/*.ts" eslint.config.mjs
- name: Test with Mocha
run: npx mocha -r ts-node/register "**/*.spec.ts"
working-directory: nodejs
Expand Down
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"bracketSpacing": false,
"overrides": [
{
"files": [".eslintrc", ".prettierrc"],
"files": ".prettierrc",
"options": {"parser": "json"}
}
]
Expand Down
8 changes: 8 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// @ts-check
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";

export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended
);
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"private": true,
"devDependencies": {
"@eslint/js": "9.6.0",
"@types/eslint__js": "8.42.3",
"@types/mocha": "10.0.7",
"@types/node": "20.14.9",
"@typescript-eslint/eslint-plugin": "7.14.1",
"@typescript-eslint/parser": "7.14.1",
"eslint": "8.57.0",
"mocha": "10.5.2",
"prettier": "3.3.2",
"ts-node": "10.9.2",
"typescript": "5.5.2",
"typescript-eslint": "7.14.1",
"pulumi-aws-tags": "file:nodejs"
}
}

0 comments on commit 9bb7f4e

Please sign in to comment.