add linter and formatter

This commit is contained in:
Kevin Gibbons 2022-12-02 18:48:53 -08:00
parent f62f584dda
commit 2dc650c76b
4 changed files with 1998 additions and 0 deletions

17
.eslintrc.js Normal file
View File

@ -0,0 +1,17 @@
'use strict';
module.exports = {
extends: ['eslint:recommended', 'eslint-config-prettier'],
parserOptions: {
ecmaVersion: 2020,
},
env: {
browser: true,
},
rules: {
strict: ['error', 'global'],
'no-unused-vars': ['error', { vars: 'local' }],
eqeqeq: ['error', 'always', { null: 'ignore' }],
curly: ['error', 'multi-line'],
'no-var': 'error',
},
};

3
.gitignore vendored
View File

@ -3,3 +3,6 @@ extension/manifest.json
# release builds
release/*
# JavaScript stuff
node_modules

1960
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

18
package.json Normal file
View File

@ -0,0 +1,18 @@
{
"name": "tubearchivist-browser-extension",
"private": true,
"scripts": {
"lint": "eslint 'extension/**/*.js'",
"format": "prettier --write 'extension/**/*.js'"
},
"devDependencies": {
"eslint": "^8.26.0",
"prettier": "^2.7.1",
"eslint-config-prettier": "^8.5.0"
},
"prettier": {
"singleQuote": true,
"arrowParens": "avoid",
"printWidth": 100
}
}