Skip to content

Commit

Permalink
chore: update eslint and CI (#532)
Browse files Browse the repository at this point in the history
* update eslint

* babel-eslint has been deprecated

* ci: update lint
  • Loading branch information
uiolee authored Oct 31, 2023
1 parent e0b3fc5 commit cad6550
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 17 deletions.
13 changes: 7 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
{
"root": true,
"parserOptions": {
"ecmaVersion": 2017
"ecmaVersion": "latest"
},
"env": {
"browser": true,
"es6": true,
"es2021": true,
"node": true,
"webextensions": true
},
"globals": {
"globalThis": false
},
"extends": [
"eslint:recommended"
],
"extends": ["eslint:recommended"],
"overrides": [],

"rules": {
"no-console": 0,
"no-unused-vars": ["warn", { "vars": "all", "args": "after-used" } ],
"no-unused-vars": ["warn", { "vars": "all", "args": "after-used" }],
"no-undef": ["warn"],
"no-proto": ["error"],
"prefer-arrow-callback": ["warn"],
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: lint
on:
pull_request:
paths:
- "**.js"

jobs:
eslint:
name: eslint
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write

steps:
- uses: actions/checkout@v4

- uses: reviewdog/action-eslint@v1
with:
reporter: github-pr-review
eslint_flags: "."
filter_mode: "file"
fail_on_error: true
3 changes: 0 additions & 3 deletions .travis.yml

This file was deleted.

11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
"version": "1.0.0",
"description": "Example Firefox add-ons created using the WebExtensions API",
"devDependencies": {
"eslint": "^4.4.1"
"@babel/eslint-parser": "^7.22.11",
"eslint": "^8.48.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/mdn/webextensions-examples.git"
},
"scripts": {
"test": "eslint .",
"lint": "eslint ."
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
"license": "MIT",
"bugs": {
Expand All @@ -25,8 +27,5 @@
"firefox",
"mozilla"
],
"homepage": "https://developer.mozilla.org/Add-ons/WebExtensions/Examples",
"dependencies": {
"babel-eslint": "^7.2.3"
}
"homepage": "https://developer.mozilla.org/Add-ons/WebExtensions/Examples"
}
2 changes: 1 addition & 1 deletion store-collected-images/webextension-plain/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"parser": "babel-eslint"
"parser": "@babel/eslint-parser"
}
2 changes: 1 addition & 1 deletion store-collected-images/webextension-with-webpack/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"env": {
"commonjs": true
}
Expand Down

0 comments on commit cad6550

Please sign in to comment.