ESLint configuration developed by the PlayCanvas team and leveraged by many PlayCanvas-related projects, including the PlayCanvas Engine. However, you can use it for any JavaScript-based project if you approve of the PlayCanvas coding style.
The configuration is defined in index.js
. It configures ESLint's rules in the same order as they are enumerated here. It also configures rules for checking JSDoc comments using the ESLint plugin eslint-plugin-jsdoc-rules
.
The configuration attempts to enable as many rules as possible, particularly those categorized as 'recommended' by ESLint.
Edit your project's package.json
file:
- Add
eslint
and@playcanvas/eslint-config
to yourdevDependencies
section. - Add an
eslintConfig
section. At a minimum, you will need:
"eslintConfig": {
"extends": "@playcanvas/eslint-config"
},