@playcanvas/eslint-config 2.1.0 → 3.0.0-beta.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/LICENSE CHANGED
@@ -1,19 +1,19 @@
1
- Copyright (c) 2011-2021 PlayCanvas Ltd.
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in
11
- all copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
1
+ Copyright (c) 2011-2021 PlayCanvas Ltd.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
package/README.md CHANGED
@@ -1,44 +1,50 @@
1
- # PlayCanvas ESLint Config
2
-
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
-
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
-
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.
12
-
13
- ## Using this config in your own projects
14
-
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:
22
-
23
- ```js
24
- import playcanvasConfig from '@playcanvas/eslint-config';
25
-
26
- export default [
27
- ...playcanvasConfig,
28
- // Your custom configurations here
29
- ];
30
- ```
31
-
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
1
+ # PlayCanvas ESLint Config
2
+
3
+ [![NPM Version](https://img.shields.io/npm/v/@playcanvas/eslint-config)](https://www.npmjs.com/package/@playcanvas/eslint-config)
4
+ [![NPM Downloads](https://img.shields.io/npm/dw/@playcanvas/eslint-config)](https://npmtrends.com/@playcanvas/eslint-config)
5
+ [![License](https://img.shields.io/npm/l/@playcanvas/eslint-config)](https://github.com/playcanvas/editor-api/blob/main/LICENSE)
6
+ [![Discord](https://img.shields.io/badge/Discord-5865F2?style=flat&logo=discord&logoColor=white&color=black)](https://discord.gg/RSaMRzg)
7
+ [![Reddit](https://img.shields.io/badge/Reddit-FF4500?style=flat&logo=reddit&logoColor=white&color=black)](https://www.reddit.com/r/PlayCanvas)
8
+ [![X](https://img.shields.io/badge/X-000000?style=flat&logo=x&logoColor=white&color=black)](https://x.com/intent/follow?screen_name=playcanvas)
9
+
10
+ | [User Manual](https://developer.playcanvas.com/user-manual/editor) | [API Reference](https://api.playcanvas.com/editor) | [Blog](https://blog.playcanvas.com) | [Forum](https://forum.playcanvas.com) |
11
+
12
+ 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.
13
+
14
+ ## Usage
15
+
16
+ 1. Install the package:
17
+
18
+ ```bash
19
+ npm install -D @playcanvas/eslint-config eslint
20
+ ```
21
+
22
+ 2. Create an `eslint.config.js` file in your project root:
23
+
24
+ ```js
25
+ import playcanvasConfig from '@playcanvas/eslint-config';
26
+
27
+ export default [
28
+ ...playcanvasConfig.typescript,
29
+ // ...playcanvasConfig.react, // Uncomment if using react
30
+ // ...playcanvasConfig.legacy, // Uncomment if using legacy javascript rules
31
+ // Your custom configurations here
32
+ ];
33
+ ```
34
+
35
+ ## Features
36
+
37
+ > [!WARNING]
38
+ > The typescript and react rules are incomplete and are still being developed based on current practises and existing legacy rules
39
+
40
+ - Full flat config format support for ESLint 9+
41
+ - Comprehensive rule configuration
42
+ - Support for ESM Script JSDoc tags used in PlayCanvas
43
+ - Import ordering and validation
44
+ - Strict JSDoc validation
45
+ - Regular expression pattern enforcement
46
+
47
+ ## Requirements
48
+
49
+ - ESLint 9 or later
50
+ - Node.js 18 or later