Skip to content

Commit

Permalink
Also lint script and config files with ESLint
Browse files Browse the repository at this point in the history
  • Loading branch information
niklashigi committed Apr 24, 2020
1 parent d4a0b75 commit 070b748
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 10 deletions.
8 changes: 8 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,12 @@ module.exports = {
singleline: { delimiter: 'comma', requireLast: false },
}],
},
overrides: [
{
files: ['**/*.js'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
}
],
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"scripts": {
"lint": "run-s lint:*",
"lint:sass": "sass-lint -v --max-warnings 0",
"lint:ts": "eslint --ext .ts,.vue source",
"lint:js": "eslint --ext .ts,.js,.vue source --ignore-path .gitignore",
"build": "NODE_ENV=production run-s build:*",
"build:clean": "rm -rf extensions/*",
"build:mkdir": "mkdir -p extensions/common extensions/chrome extensions/firefox",
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate-manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ for (const browser of ['chrome', 'firefox']) {
const json = JSON.stringify(manifest, null, 2)
fs.writeFileSync(
path.resolve(__dirname, `../extensions/${browser}/manifest.json`),
json
json,
)
}
8 changes: 5 additions & 3 deletions source/manifest.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/camelcase */

const domains = [
'primevideo.com',
'amazon.com',
Expand Down Expand Up @@ -31,7 +33,7 @@ module.exports = (version, browser) => {
matches: urlMatches,
js: ['content.js'],
css: ['content.css'],
}
},
],
manifest_version: 2,
}
Expand All @@ -51,8 +53,8 @@ module.exports = (version, browser) => {
manifest.applications = {
gecko: {
id: '{d2d5c630-405c-4415-a627-e6c90dd8f568}',
strict_min_version: '55.0'
}
strict_min_version: '55.0',
},
}

// Add host permissions required to work around Firefox's CSP implementation
Expand Down
11 changes: 6 additions & 5 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const TerserPlugin = require('terser-webpack-plugin')
const VueLoaderPlugin = require('vue-loader/lib/plugin')

const extensionDirectory = process.env.NODE_ENV === 'development' ? 'chrome' : 'common'
const extensionDirectory =
process.env.NODE_ENV === 'development' ? 'chrome' : 'common'

module.exports = {
entry: {
Expand All @@ -15,14 +16,14 @@ module.exports = {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
loader: 'vue-loader',
},
{
test: /\.tsx?$/,
loader: 'ts-loader',
options: { appendTsSuffixTo: [/\.vue$/] }
}
]
options: { appendTsSuffixTo: [/\.vue$/] },
},
],
},
optimization: {
minimizer: [
Expand Down

0 comments on commit 070b748

Please sign in to comment.