npm install eslint-plugin-html eslint-config-prettier eslint-plugin-prettier tslint-config-prettier --dev
or
yarn add eslint-plugin-html eslint-config-prettier eslint-plugin-prettier tslint-config-prettier --dev
which node
should = /usr/local/bin/node
nvm deactivate
npm install -g typescript eslint tslint prettier eslint-plugin-html eslint-config-prettier eslint-plugin-prettier tslint-config-prettier js-beautify
check globally installed modules to verify the above
npm list --depth=0 -g
gem install scss_lint
apm install linter linter-eslint linter-tslint prettier-atom linter-scss-lint linter-json-lint atom-beautify
- HTML
- default beautifier: JS Beautify
- beautify_on_save: true
- end_with_newline: true
- wrap_attributes: "force-aligned"
- scss
- convert_quotes: "single"
- default_beautifier: "Prettier"
- disable when no eslint found
- lint html files
- show rule id in message
- use global eslint installation
- globalNodePath: "/usr/local"
- try to use project tslint
- use global tslint install
- eslint integration
- editor config integration
- format on save (all 3)
- only format if a prettier config file is found
- disable when no eslint found
- allow comments
Check the following files in the project, along with package defaults (ie prettier has 80 char default max-len) to determine the conventions
- tslint.json
- tsconfig.json
- .eslintrc.json
- .prettierrc
- .jsbeautifyrc
- .scss-lint.yml
NOTE: several of these files are overridden by atom config, but useful for commandline calls, and should reflect atom config
prettier --write "**/*"
js-beautify -r --config .jsbeautifyrc **/*.html
scss-lint -c .scss-lint.yml **/*.scss
Note this will only output issues and not modify files.
For sublime or IDE agnostic auto linting, install and setup the onchange package to watch for file changes like so:
https://prettier.io/docs/en/watching-files.html
https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
"[javascriptreact]": {
"editor.rulers": [100],
"editor.formatOnSave": true
},
"[javascript]": {
"editor.rulers": [100],
"editor.formatOnSave": true
},
"prettier.requireConfig": true