Skip to content

Commit

Permalink
update eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
uiolee committed Jul 7, 2023
1 parent ff1cd27 commit e0ace99
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 34 deletions.
37 changes: 37 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module.exports = {
'root': true,
'env': {
'browser': true,
'es2021': true,
'node': true,
'webextensions': true
},
'extends': [
'eslint:recommended',
'plugin:@typescript-eslint/recommended'
],
'globals': {
'globalThis': false
},
'overrides': [
],
'parser': '@typescript-eslint/parser',
'parserOptions': {
'ecmaVersion': 'latest'
},
'plugins': [
'@typescript-eslint'
],
'rules': {
'no-console': 0,
'no-unused-vars': ['warn', { 'vars': 'all', 'args': 'after-used' }],
'no-undef': ['warn'],
'no-proto': ['error'],
'prefer-arrow-callback': ['warn'],
'prefer-spread': ['warn'],
'indent': ['error', 2],
'linebreak-style': ['error', 'unix'],
'quotes': ['error', 'single'],
'semi': ['error', 'always']
}
};
25 changes: 0 additions & 25 deletions .eslintrc.json

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: lint
on: [pull_request]

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

steps:
- uses: actions/checkout@v3

- 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.

13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@
"version": "1.0.0",
"description": "Example Firefox add-ons created using the WebExtensions API",
"devDependencies": {
"eslint": "^4.4.1"
"@typescript-eslint/eslint-plugin": "^5.61.0",
"@typescript-eslint/parser": "^5.61.0",
"babel-eslint": "^10.1.0",
"eslint": "^8.44.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 +29,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"
}

0 comments on commit e0ace99

Please sign in to comment.