Remove Prettier, Add ESLint

Delete prettier files
merge-requests/43/head
Sebastian Delmont 2020-12-13 19:56:41 -05:00
rodzic 8cb284fbcc
commit c0395fcdf9
5 zmienionych plików z 52 dodań i 31 usunięć

42
.eslintrc.js 100644
Wyświetl plik

@ -0,0 +1,42 @@
module.exports = {
env: {
browser: true,
commonjs: true,
es6: true,
node: true
},
extends: [
"standard"
],
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly"
},
parserOptions: {
ecmaVersion: 2018
},
rules: {
/* See https://eslint.org/docs/rules/ */
/* 0: off, 1: warn, 2: error */
/* Style rules reflecting Tag's preferences */
"brace-style": [1, "allman", { allowSingleLine: true }],
quotes: [2, "double"],
camelcase: 0,
semi: 0,
"space-before-function-paren": 0,
"one-var": 0,
/* ESLint checks we should consider fixing in the future */
eqeqeq: 0,
"no-unused-vars": 0,
"no-redeclare": 0,
"no-undef": 0,
"no-array-constructor": 0,
"prefer-const": 0,
"no-var": 0,
"no-extend-native": 0,
"prefer-regex-literals": 0,
"no-prototype-builtins": 0
}
};

Wyświetl plik

@ -1,10 +0,0 @@
node_modules/
macos/
debian/
build/
package.nw/lib/ol.js
package.nw/lib/moment-with-locales.js
package.nw/lib/moment-timezone-with-data.js
package.nw/lib/datepicker.js
package.nw/lib/third-party.js

Wyświetl plik

@ -1,11 +0,0 @@
{
"printWidth": 80,
"overrides": [
{
"files": ["*.html"],
"options": {
"printWidth": 120
}
}
]
}

Wyświetl plik

@ -13,16 +13,11 @@ among other things.
### Code Formatting ### Code Formatting
We use `prettier` to enforce code formatting rules, and we follow We use `eslint` to enforce code formatting rules.
the [JavaScript Standard Style](https://standardjs.com/)
You can use all kinds of plugins and configurations in your text editor to verify these rules, and even reformat code You can use all kinds of plugins and configurations in your text editor to verify these rules, and even reformat code
automatically, but if you want to run on the command line, you can (after running `npm install`) run the automatically, but if you want to run on the command line, you can (after running `npm install`) run the
`npm run prettier-check` command to verify the formatting of all files, or `npm run prettier-write` to reformat `npm run lint-check` command to verify the formatting of all files, or `npm run lint-fix` to reformat all files to match the standard.
all files to match the standard.
If you want to know more about why these tools are useful,
[watch this talk](https://www.youtube.com/watch?v=kuHfMw8j4xk)
# Developer Environment Setup # Developer Environment Setup

Wyświetl plik

@ -2,13 +2,18 @@
"name": "gridtracker-development", "name": "gridtracker-development",
"version": "1.0.0", "version": "1.0.0",
"devDependencies": { "devDependencies": {
"eslint": "^7.15.0",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"nwjs-builder-phoenix": "^1.15.0", "nwjs-builder-phoenix": "^1.15.0",
"prettier": "^2.2.1" "prettier": "^2.2.1"
}, },
"scripts": { "scripts": {
"test": "npm run prettier-check", "test": "eslint package.nw",
"prettier-check": "npx prettier --check package.nw", "lint-check": "eslint --fix package.nw",
"prettier-write": "npx prettier --write package.nw", "lint-fix": "eslint --fix package.nw",
"dist": "build --concurrent --tasks win-x86,win-x64,linux-x86,linux-x64,mac-x64 package.nw", "dist": "build --concurrent --tasks win-x86,win-x64,linux-x86,linux-x64,mac-x64 package.nw",
"distsome": "build --debug --tasks linux-x64,mac-x64 package.nw", "distsome": "build --debug --tasks linux-x64,mac-x64 package.nw",
"start": "run package.nw" "start": "run package.nw"