mirror of
https://github.com/cse110-fa22-group29/cse110-fa22-group29.git
synced 2024-12-28 01:39:09 +00:00
implement basic linting with eslint,
fix linting errors in testenv module Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
parent
50f0679a76
commit
a6015aff3b
33
.eslintrc.json
Normal file
33
.eslintrc.json
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"es2021": true,
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"extends": "eslint:recommended",
|
||||||
|
"overrides": [
|
||||||
|
],
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": "latest",
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"indent": [
|
||||||
|
"error",
|
||||||
|
"tab"
|
||||||
|
],
|
||||||
|
"linebreak-style": [
|
||||||
|
"error",
|
||||||
|
"unix"
|
||||||
|
],
|
||||||
|
"quotes": [
|
||||||
|
"error",
|
||||||
|
"double"
|
||||||
|
],
|
||||||
|
"semi": [
|
||||||
|
"error",
|
||||||
|
"always"
|
||||||
|
],
|
||||||
|
"no-global-assign": 0
|
||||||
|
}
|
||||||
|
}
|
11
package.json
11
package.json
@ -2,9 +2,16 @@
|
|||||||
"name": "food-journal",
|
"name": "food-journal",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "mocha --recursive **/*.test.js"
|
"test": "mocha --recursive **/*.test.js",
|
||||||
|
"lint": "eslint **/*.js",
|
||||||
|
"fix-style": "eslint --fix **/*.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"devDependencies": {
|
||||||
|
"eslint": "^8.27.0",
|
||||||
|
"eslint-config-standard": "^17.0.0",
|
||||||
|
"eslint-plugin-import": "^2.26.0",
|
||||||
|
"eslint-plugin-n": "^15.5.0",
|
||||||
|
"eslint-plugin-promise": "^6.1.1",
|
||||||
"mocha": "10"
|
"mocha": "10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
const {environment} = require("./testenv.js");
|
const {environment} = require("./testenv.js");
|
||||||
var assert = require('assert');
|
var assert = require("assert");
|
||||||
var {saveToLocal, getFromLocal, removeFromLocal, clearLocal} = require('./testenv_helpers');
|
var {describe, it, beforeEach} = require("mocha");
|
||||||
|
var {saveToLocal, getFromLocal, removeFromLocal, clearLocal} = require("./testenv_helpers");
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
window = environment();
|
window = environment();
|
||||||
|
Loading…
Reference in New Issue
Block a user