Skip to content

Commit 9c00306

Browse files
authored
πŸ’„ Migrate to ESLint v9.16.0 (#25)
* Migrate to ESLint `v9.16.0` * πŸ‘· Add lint to CI
1 parent 03f70ed commit 9c00306

5 files changed

Lines changed: 1607 additions & 40 deletions

File tree

β€Ž.eslint.config.mjsβ€Ž

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import globals from "globals";
2+
import pluginJs from "@eslint/js";
3+
import tseslint from "typescript-eslint";
4+
import stylisticJs from '@stylistic/eslint-plugin-js'
5+
6+
7+
/** @type {import('eslint').Linter.Config[]} */
8+
export default [
9+
{ plugins: {
10+
'@stylistic/js': stylisticJs
11+
}, rules: {
12+
'@stylistic/js/indent': ['error', 4],
13+
}
14+
},
15+
{files: ["**/*.{js,mjs,cjs,ts}"]},
16+
{files: ["**/*.js"], languageOptions: {sourceType: "commonjs"}},
17+
{languageOptions: { globals: globals.browser }},
18+
pluginJs.configs.recommended,
19+
...tseslint.configs.recommended,
20+
];

β€Ž.eslintrc.jsonβ€Ž

Lines changed: 0 additions & 22 deletions
This file was deleted.

β€Ž.github/workflows/lint.ymlβ€Ž

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: ESLint
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
schedule:
9+
- cron: '30 12 * * 3'
10+
11+
jobs:
12+
eslint:
13+
name: Run eslint scanning
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
security-events: write
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Install ESLint
23+
run: |
24+
npm install
25+
npm install @microsoft/eslint-formatter-sarif
26+
27+
- name: Run ESLint
28+
env:
29+
SARIF_ESLINT_IGNORE_SUPPRESSED: "true"
30+
run: npx eslint src/**/*
31+
--config .eslint.config.mjs
32+
--format @microsoft/eslint-formatter-sarif
33+
--output-file eslint-results.sarif
34+
continue-on-error: true
35+
36+
- name: Upload analysis results to GitHub
37+
uses: github/codeql-action/upload-sarif@v3
38+
with:
39+
sarif_file: eslint-results.sarif
40+
wait-for-processing: true
41+

0 commit comments

Comments
Β (0)