@automattic/eslint-plugin-wpvip 0.9.1 → 0.10.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
@@ -72,10 +72,10 @@ Note that the order of configs can matter, since they can contain overrides. It
72
72
 
73
73
  ### Prettier
74
74
 
75
- Install [WP Prettier](https://github.com/Automattic/wp-prettier) to benefit from additional formatting rules:
75
+ Install [WP Prettier](https://github.com/Automattic/wp-prettier) v2.x to benefit from additional formatting rules:
76
76
 
77
77
  ```sh
78
- npm i --save-dev --save-exact "prettier@npm:wp-prettier@latest"
78
+ npm i --save-dev --save-exact "prettier@npm:wp-prettier@2.8.5"
79
79
  ```
80
80
 
81
81
  This repo also provides a Prettier config, which you can use with the following `.prettierrc`:
@@ -100,7 +100,7 @@ module.exports = {
100
100
  };
101
101
  ```
102
102
 
103
- If your project is not a CLI tool but calls `console` or `process` methods occasionally, you probably don't need this config. Instead, disable those rules only where necessary and include an explanation:
103
+ If your project is not a CLI tool but calls `process` methods occasionally, you probably don't need this config. Instead, disable those rules only where necessary and include an explanation:
104
104
 
105
105
  ```js
106
106
  // Intentionally exiting because we have observed an unrecoverable error.
@@ -108,6 +108,12 @@ If your project is not a CLI tool but calls `console` or `process` methods occas
108
108
  process.exit( 1 );
109
109
  ```
110
110
 
111
+ Note that `console.log` is still forbidden ([see here for an explanation](https://github.com/Automattic/eslint-config-wpvip/pull/198#issuecomment-2015322062)). If you're writing one-off Node scripts, you can disable the rule per file:
112
+
113
+ ```js
114
+ /* eslint-disable no-console */
115
+ ```
116
+
111
117
  ## JSDoc
112
118
 
113
119
  JSDoc is considered optional, especially compared to better alternatives like TypeScript and OpenAPI documentation. If you want to enforce the use of JSDoc, use the `jsdoc` config:
@@ -254,7 +254,7 @@ module.exports = {
254
254
  settings: {
255
255
  'import/resolver': {
256
256
  node: {
257
- extensions: [ '.js', '.jsx', '.ts', '.tsx' ],
257
+ extensions: [ '.js', '.jsx', '.ts', '.tsx', '.cjs', '.mjs', '.cts', '.mts' ],
258
258
  },
259
259
  typescript: 'eslint-import-resolver-typescript',
260
260
  },
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  module.exports = {
7
- ignorePatterns: [ '**/*.d.ts' ],
7
+ ignorePatterns: [ '**/*.d.ts', '**/*.d.cts', '**/*.d.mts' ],
8
8
 
9
9
  overrides: [
10
10
  {
@@ -14,7 +14,7 @@ module.exports = {
14
14
  'plugin:@typescript-eslint/strict',
15
15
  ],
16
16
 
17
- files: [ '**/*.ts', '**/*.tsx' ],
17
+ files: [ '**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts' ],
18
18
 
19
19
  parser: '@typescript-eslint/parser',
20
20
 
@@ -7,7 +7,7 @@
7
7
  module.exports = {
8
8
  overrides: [
9
9
  {
10
- files: [ '**/*.ts', '**/*.tsx' ],
10
+ files: [ '**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts' ],
11
11
 
12
12
  /**
13
13
  * Downgrade rules from the base preset to "warn". Do not disable rules (set
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/eslint-plugin-wpvip",
3
- "version": "0.9.1",
3
+ "version": "0.10.0",
4
4
  "description": "ESLint plugin for internal WordPress VIP projects",
5
5
  "main": "index.js",
6
6
  "scripts": {