@playcanvas/eslint-config 3.0.0-beta.1 → 3.0.0-beta.3

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
@@ -62,6 +62,22 @@ export default [
62
62
  ];
63
63
  ```
64
64
 
65
+ 3. Prettier is run as a separate step, not through ESLint — the config above only disables the ESLint formatting rules that would conflict with Prettier. To apply the PlayCanvas house style, create a `prettier.config.mjs` that re-exports the shared config:
66
+
67
+ ```js
68
+ export { default } from '@playcanvas/eslint-config/prettier';
69
+ ```
70
+
71
+ Then run both, for example:
72
+
73
+ ```json
74
+ {
75
+ "scripts": {
76
+ "lint": "prettier --check . && eslint ."
77
+ }
78
+ }
79
+ ```
80
+
65
81
  ## Features
66
82
 
67
83
  > [!WARNING]
@@ -0,0 +1,9 @@
1
+ // shared PlayCanvas Prettier config — the single source of the house style.
2
+ // consume from a prettier.config.mjs: export { default } from '@playcanvas/eslint-config/prettier'
3
+ export default {
4
+ tabWidth: 4,
5
+ singleQuote: true,
6
+ printWidth: 120,
7
+ trailingComma: 'none'
8
+ };
9
+ //# sourceMappingURL=prettier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prettier.js","sourceRoot":"","sources":["../../src/configs/prettier.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,mGAAmG;AACnG,eAAe;IACX,QAAQ,EAAE,CAAC;IACX,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,GAAG;IACf,aAAa,EAAE,MAAM;CACxB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import eslint from '@eslint/js';
2
+ import eslintConfigPrettier from 'eslint-config-prettier/flat';
2
3
  import pluginImport from 'eslint-plugin-import';
3
4
  import * as pluginPackageJson from 'eslint-plugin-package-json';
4
- import pluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
5
5
  import globals from 'globals';
6
6
  import jsoncEslintParser from 'jsonc-eslint-parser';
7
7
  import tseslint from 'typescript-eslint';
@@ -68,11 +68,13 @@ export default [
68
68
  ...tseslint.configs.recommended,
69
69
  ...tseslint.configs.strict,
70
70
  ...tseslint.configs.stylistic,
71
- pluginPrettierRecommended,
72
71
  pluginImport.flatConfigs.recommended,
73
72
  ignoreConfig,
74
73
  baseConfig,
75
74
  tsFilesConfig,
76
- packageJsonConfig
75
+ packageJsonConfig,
76
+ // last: turn off ESLint formatting rules that would conflict with Prettier
77
+ // (run Prettier itself separately — see the prettier export / README)
78
+ eslintConfigPrettier
77
79
  ];
78
80
  //# sourceMappingURL=typescript.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"typescript.js","sourceRoot":"","sources":["../../src/configs/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,YAAY,CAAC;AAChC,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,iBAAiB,MAAM,4BAA4B,CAAC;AAChE,OAAO,yBAAyB,MAAM,oCAAoC,CAAC;AAC3E,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AAEzC,MAAM,YAAY,GAAG;IACjB,OAAO,EAAE,CAAC,iBAAiB,EAAE,SAAS,CAAC;CAC1C,CAAC;AAEF,MAAM,UAAU,GAAG;IACf,KAAK,EAAE;QACH,KAAK,EAAE,OAAO;QACd,cAAc,EAAE;YACZ,OAAO;YACP;gBACI,WAAW,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE;gBACpD,kBAAkB,EAAE,QAAQ;gBAC5B,MAAM,EAAE,CAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC;aACtF;SACJ;QACD,yCAAyC,EAAE,KAAK;QAChD,gDAAgD,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;QACnE,mCAAmC,EAAE;YACjC,OAAO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,EAAE;QACH,4CAA4C,EAAE,OAAO;QACrD,sCAAsC,EAAE,KAAK;QAC7C,0CAA0C,EAAE,KAAK;KACpD;CACJ,CAAC;AAEF,MAAM,iBAAiB,GAAG;IACtB,KAAK,EAAE,CAAC,iBAAiB,EAAE,sBAAsB,CAAC;IAClD,eAAe,EAAE;QACb,MAAM,EAAE,iBAAiB;KAC5B;IACD,OAAO,EAAE;QACL,cAAc,EAAE,iBAAiB;KACpC;IACD,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK;CACrD,CAAC;AAEF,eAAe;IACX,MAAM,CAAC,OAAO,CAAC,WAAW;IAC1B,GAAG,QAAQ,CAAC,OAAO,CAAC,WAAW;IAC/B,GAAG,QAAQ,CAAC,OAAO,CAAC,MAAM;IAC1B,GAAG,QAAQ,CAAC,OAAO,CAAC,SAAS;IAC7B,YAAY,CAAC,WAAW,CAAC,WAAW;IACpC,YAAY;IACZ,UAAU;IACV,aAAa;IACb,iBAAiB;IAEjB,2EAA2E;IAC3E,sEAAsE;IACtE,oBAAoB;CACvB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playcanvas/eslint-config",
3
- "version": "3.0.0-beta.1",
3
+ "version": "3.0.0-beta.3",
4
4
  "description": "ESLint configuration used by PlayCanvas",
5
5
  "keywords": [
6
6
  "config",
@@ -22,11 +22,16 @@
22
22
  ".": "./dist/index.js",
23
23
  "./javascript": "./dist/configs/legacy.js",
24
24
  "./legacy": "./dist/configs/legacy.js",
25
+ "./prettier": {
26
+ "types": "./types/prettier.d.ts",
27
+ "default": "./dist/configs/prettier.js"
28
+ },
25
29
  "./react": "./dist/configs/react.js",
26
30
  "./typescript": "./dist/configs/typescript.js"
27
31
  },
28
32
  "files": [
29
- "dist"
33
+ "dist",
34
+ "types"
30
35
  ],
31
36
  "scripts": {
32
37
  "build": "npm run clean && tsc",
@@ -45,7 +50,6 @@
45
50
  "eslint-plugin-jsdoc": "^61.1.11",
46
51
  "eslint-plugin-jsx-a11y": "^6.10.2",
47
52
  "eslint-plugin-package-json": "^0.59.1",
48
- "eslint-plugin-prettier": "^5.5.4",
49
53
  "eslint-plugin-react": "^7.37.5",
50
54
  "eslint-plugin-react-hooks": "^7.0.1",
51
55
  "eslint-plugin-regexp": "^2.10.0",
@@ -56,6 +60,7 @@
56
60
  "devDependencies": {
57
61
  "@types/eslint-plugin-jsx-a11y": "^6.10.1",
58
62
  "eslint": "^9.39.0",
63
+ "prettier": "^3.6.2",
59
64
  "publint": "^0.3.15",
60
65
  "typescript": "^5.9.3"
61
66
  },
@@ -0,0 +1,12 @@
1
+ // types for the shared Prettier config (@playcanvas/eslint-config/prettier).
2
+ // hand-written and kept in sync with src/configs/prettier.ts — the eslint configs
3
+ // can't emit declarations (typescript-eslint composed types aren't portable), so
4
+ // only this simple config ships types.
5
+ declare const config: {
6
+ tabWidth: number;
7
+ singleQuote: boolean;
8
+ printWidth: number;
9
+ trailingComma: 'none';
10
+ };
11
+
12
+ export default config;