Skip to content

Commit

Permalink
Update dependency eslint to v9 (#52)
Browse files Browse the repository at this point in the history
* Update dependency eslint to v9

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
renovate[bot] authored Sep 7, 2024
1 parent 713c7fd commit 37d2b52
Show file tree
Hide file tree
Showing 7 changed files with 347 additions and 279 deletions.
29 changes: 0 additions & 29 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,27 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: ${{ matrix.node-version }}
- run: npm ci

publish-npm:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run lint
Expand Down
46 changes: 46 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import prettier from "eslint-plugin-prettier";
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"), {
plugins: {
prettier,
},

languageOptions: {
globals: {
...globals.browser,
...globals.commonjs,
},

ecmaVersion: "latest",
sourceType: "script",
},

rules: {
indent: ["error", 2],
"linebreak-style": ["error", "unix"],
quotes: ["error", "double"],
semi: ["error", "always"],
"prettier/prettier": "error",
},
}, {
files: ["**/*.test.js"],

languageOptions: {
globals: {
...globals.jest,
},
},
}];
Loading

0 comments on commit 37d2b52

Please sign in to comment.