@playcanvas/eslint-config 2.0.8 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,25 +1,44 @@
1
1
  # PlayCanvas ESLint Config
2
2
 
3
- ESLint configuration developed by the PlayCanvas team and leveraged by many PlayCanvas-related projects, including the [PlayCanvas Engine][engine]. However, you can use it for any JavaScript-based project if you approve of the PlayCanvas coding style.
3
+ ESLint configuration developed by the PlayCanvas team and leveraged by many PlayCanvas-related projects, including the [PlayCanvas Engine](https://github.com/playcanvas/engine). However, you can use it for any JavaScript-based project if you approve of the PlayCanvas coding style.
4
4
 
5
- The configuration is defined in [`index.js`][index]. It configures ESLint's rules in the same order as they are enumerated [here][rules]. It also configures rules for checking JSDoc comments using the ESLint plugin [`eslint-plugin-jsdoc-rules`][jsdoc-plugin].
5
+ The configuration is defined in [`eslint.config.mjs`](https://github.com/playcanvas/eslint-config/blob/main/eslint.config.mjs). It configures ESLint's rules in a comprehensive manner, covering Possible Problems, Suggestions, and Formatting categories. It also includes additional plugins:
6
6
 
7
- The configuration attempts to enable as many rules as possible, particularly those categorized as 'recommended' by ESLint.
7
+ - `eslint-plugin-jsdoc`: For JSDoc validation and enforcement
8
+ - `eslint-plugin-import`: For import/export validation and ordering
9
+ - `eslint-plugin-regexp`: For regular expression best practices
10
+
11
+ The configuration attempts to enable as many rules as possible, particularly those categorized as 'recommended' by ESLint, while maintaining practicality for real-world development.
8
12
 
9
13
  ## Using this config in your own projects
10
14
 
11
- Edit your project's `package.json` file:
15
+ 1. Install the package:
16
+
17
+ ```bash
18
+ npm install --save-dev @playcanvas/eslint-config eslint
19
+ ```
20
+
21
+ 2. Create an `eslint.config.js` file in your project root:
12
22
 
13
- 1. Add `eslint` and `@playcanvas/eslint-config` to your `devDependencies` section.
14
- 2. Add an `eslintConfig` section. At a minimum, you will need:
23
+ ```js
24
+ import playcanvasConfig from '@playcanvas/eslint-config';
15
25
 
16
- ```json
17
- "eslintConfig": {
18
- "extends": "@playcanvas/eslint-config"
19
- },
26
+ export default [
27
+ ...playcanvasConfig,
28
+ // Your custom configurations here
29
+ ];
20
30
  ```
21
31
 
22
- [engine]: https://github.com/playcanvas/engine
23
- [index]: https://github.com/playcanvas/playcanvas-eslint-config/blob/master/index.js
24
- [rules]: https://eslint.org/docs/rules/
25
- [jsdoc-plugin]: https://github.com/gajus/eslint-plugin-jsdoc
32
+ ## Features
33
+
34
+ - Full flat config format support for ESLint 8+
35
+ - Comprehensive rule configuration
36
+ - Support for ESM Script JSDoc tags used in PlayCanvas
37
+ - Import ordering and validation
38
+ - Strict JSDoc validation
39
+ - Regular expression pattern enforcement
40
+
41
+ ## Requirements
42
+
43
+ - ESLint 8 or later
44
+ - Node.js 16 or later
package/eslint.config.mjs CHANGED
@@ -13,7 +13,9 @@ const esmScriptTags = [
13
13
  'precision',
14
14
  'size',
15
15
  'step',
16
- 'title'
16
+ 'title',
17
+ 'visibleif',
18
+ 'enabledif'
17
19
  ]
18
20
 
19
21
  export default [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playcanvas/eslint-config",
3
- "version": "2.0.8",
3
+ "version": "2.1.0",
4
4
  "author": "PlayCanvas <support@playcanvas.com>",
5
5
  "homepage": "https://playcanvas.com",
6
6
  "description": "ESLint configuration used by PlayCanvas",
@@ -26,8 +26,8 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "eslint-plugin-import": "^2.31.0",
29
- "eslint-plugin-jsdoc": "^50.3.1",
30
- "eslint-plugin-regexp": "^2.6.0"
29
+ "eslint-plugin-jsdoc": "^50.6.11",
30
+ "eslint-plugin-regexp": "^2.7.0"
31
31
  },
32
32
  "scripts": {
33
33
  "test": "echo \"Error: no test specified\" && exit 1"