Closed mwcz closed 6 years ago
I would recommend adding the examples
directory to the ESLint scan as well - turns out, there are quite a few issues there.
So, that would mean that in the package.json
we would change the scripts definition to:
"scripts": {
"..."
"eslint": "./node_modules/.bin/eslint src examples",
"eslint-fix": "./node_modules/.bin/eslint --fix src examples",
"..."
}
@blalasaadri I also wanted to add the examples dir, but it required cleanup I wasn't ready to do yet (time constraints). Part of the problem is the lib
dir, which has files we definitely don't want to lint. I'll update this PR with a .eslintignore
file to exclude lib
.
Thanks @blalasaadri !
It seems the Travis build is now failing because it's merging this branch onto master and the main_text.js
file there doesn't yet follow the new guidelines. I've looked into it and the only problem I can't seem to be able to fix is that the variable text
is unused; maybe @JeffreyBrettColeman (who added that variable) can help here? My change with everything working except for that is at https://github.com/blalasaadri/hero-engine/commit/f43159358d824a35f566f13b715fbc9b649c68ec.
@blalasaadri @JeffreyBrettColeman I applied @blalasaadri's fix and also removed the line length linting rule (prettier handles that for everything but comments, which don't seem worth enforcing).
This adds prettier code formatting. It will be applied when
eslint --fix
is run. It also addseslint-plugin-import
which lints imports and exports. For example if you try toimport { fooBlah } from "./lib.js"
and lib.js doens't have a fooBlah export, eslint will error.It also adds husky and lint-staged to allow linting to happen when a file is staged in git. There was already a precommit npm script but precommit requires husky and (optionally) lint-staged to be installed in order to work. npm itself doesn't have a precommit script.