diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..04fbb90 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,44 @@ +{ + "env": { + "browser": true, + "amd": true, + }, + "extends": [ + "eslint:recommended", + ], + "parserOptions": { + "ecmaVersion": 2018, + "sourceType": "module" + }, + "globals": { + "module": true, + "gtag": true, + "List": true + }, + "rules": { + "indent": [ + "error", + 2 + ], + "linebreak-style": [ + "error", + "unix" + ], + "semi": [ + "error", + "never" + ], + "arrow-parens": [ + "error", + "always" + ], + "global-require": [ + "error" + ], + "no-console": [ + "error", { + "allow": ["log"] + } + ] + } +} diff --git a/.gitignore b/.gitignore index 630bac5..d099c3c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.DS_Store +*.swp .build build node_modules diff --git a/package.json b/package.json index 85a8cdb..9d5eb79 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,8 @@ "scripts": { "dev": "snowpack dev", "build": "snowpack build", + "lint": "eslint --ext .js src", + "lint:fix": "eslint --ext .js src --fix", "snowpack": "snowpack", "test": "npm run build && npm run test:headless", "test:functional": "testcafe", @@ -25,6 +27,7 @@ "@snowpack/plugin-babel": "^1.0.0", "@snowpack/plugin-dotenv": "^1.1.1", "@snowpack/plugin-webpack": "^1.2.0", + "eslint": "^7.13.0", "pulltorefreshjs": "^0.1.20", "rollup-plugin-node-polyfills": "^0.2.1", "snowpack": "^2.5.1",