Linting using Eslint - Memory-Lane-COS301/miniproject-2023 GitHub Wiki
Guide for Local Linting
- Go to the folder/file you have modified
- Copy the relative Path
- Go to the root of the project and run
yarn lint relative/path/to/modified/fileOrFolder
- The syntax will be fixed were possible, detailed errors will be produced, which should be fixed
- Fix remaining errors, if any
- Test by running the command again
yarn lint relative/path/to/modified/file
Additional info
- Eslint supports linting an entire folder, meaing you can lint an entire foler, if you paste it's relative path
- Use Git status to check all the files you have modified and ensure that they have been linted
Currently Set-up rules:
- Maximum length per line of code is set at 120 chars, excluding urls
"max-len":["error",{"code":120,"ignoreUrls":true}]
- No spacing before a semi colon, spacing after it
"semi-spacing": ["error", {"before": false, "after": true}]
Important
- There are many more rules applied than the ones listed above since we are extending from other standard rules