Skip to content

Commit

Permalink
Merge pull request #42 from Cardistymo/master
Browse files Browse the repository at this point in the history
Migrate ESLint to new config file format
  • Loading branch information
BluCobalt authored Jul 11, 2024
2 parents 98b4baf + 1b8a892 commit e6cce67
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install globals
- run: npm install @eslint/eslintrc
- run: npm install @eslint/js
- run: npx eslint .
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repos:
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v9.6.0
hooks:
- id: eslint
28 changes: 28 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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.browser,
},

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

rules: {
"no-unused-vars": 0,
},
}];

0 comments on commit e6cce67

Please sign in to comment.