Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update eslint and CI #532

Merged
merged 4 commits into from
Oct 31, 2023
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
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