Set up GPFJS and E2E lintersΒΆ
To get the linting modules, run the following command in the gpfjs/e2e repo:
npm install
The versions of the linters are in the package.json file.
ESLint is used for linting both TS and HTML. It uses prettifier and angular plugin for the HTML. The rules for the lint are configured in these files in the root directory of the project: .eslintrc.json, .prettierrc.json.
Stylelint is used for CSS, rules are in the .stylelintrc.json file.
To run TS/HTML lint:
./node_modules/eslint/bin/eslint.js "**/*.{html,ts}"
To get the output in .xml format report:
./node_modules/eslint/bin/eslint.js "**/*.{html,ts}" --format checkstyle > ts-lint-report.xml
To run CSS lint:
./node_modules/.bin/stylelint "**/*.css"
To get the output in .xml format report:
./node_modules/.bin/stylelint --custom-formatter ./node_modules/stylelint-checkstyle-formatter "**/*.css" > css-lint-report.xml
Extensions for Visual Studio Code:
Typescript: https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint
HTML: https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
CSS: https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint
Angular: https://marketplace.visualstudio.com/items?itemName=Angular.ng-template