Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: ESLint

on:
pull_request:
push:
branches:
- main

jobs:
lint:
name: Run ESLint
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install ESLint and GHA Formatter
run: |
npm install --save-dev globals eslint-formatter-gha eslint-plugin-jsdoc @eslint/json @eslint/js

- name: Run ESLint with GHA Formatter
run: npx eslint . -f gha
54 changes: 54 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import globals from "globals";
import js from "@eslint/js";
import json from "@eslint/json";
import jsdoc from "eslint-plugin-jsdoc";
import { defineConfig } from "eslint/config";

export default defineConfig([
{
files: ["**/*.js"],
plugins: {
js,
jsdoc,
},
languageOptions: {
globals: {
...globals.browser,
...globals.webextensions
},
parserOptions: {
ecmaFeatures: {
impliedStrict: true,
}
}
},
rules: {
"no-console": "warn",
"semi": ["error", "always"],
"quotes": ["error", "double"],
"no-unused-vars": "error",
"prefer-const": "error",
"eqeqeq": ["warn", "smart"],
"jsdoc/check-syntax": "error",
"jsdoc/check-types": "error",
"jsdoc/valid-types": "error",
},
linterOptions: {
reportUnusedInlineConfigs: "error",
},
extends: ["js/recommended"],
},
{
files: ["**/*.json"],
plugins: {
json,
},
language: "json/json",
rules: {
"json/no-duplicate-keys": "error",
"json/no-empty-keys": "error",
"json/no-unsafe-values": "warn",
"json/no-unnormalized-keys": "error",
},
}
]);
Loading