@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 +33 -14
- package/eslint.config.mjs +3 -1
- package/package.json +3 -3
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]
|
|
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 [`
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
14
|
-
|
|
23
|
+
```js
|
|
24
|
+
import playcanvasConfig from '@playcanvas/eslint-config';
|
|
15
25
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
export default [
|
|
27
|
+
...playcanvasConfig,
|
|
28
|
+
// Your custom configurations here
|
|
29
|
+
];
|
|
20
30
|
```
|
|
21
31
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@playcanvas/eslint-config",
|
|
3
|
-
"version": "2.0
|
|
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.
|
|
30
|
-
"eslint-plugin-regexp": "^2.
|
|
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"
|