Skip to content

Commit 9ff0049

Browse files
authored
Broaden ESLint Node.js configuration to apply to nested directories (#103550)
1 parent 5720c76 commit 9ff0049

File tree

13 files changed

+1
-27
lines changed

13 files changed

+1
-27
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module.exports = {
6060
},
6161
},
6262
{
63-
files: [ 'bin/**/*', 'test/**/*' ],
63+
files: [ '**/bin/**/*', '**/test/**/*', 'webpack.config.js' ],
6464
...nodeConfig,
6565
},
6666
{

apps/happy-blocks/bin/build-translations-manifest.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env node
22

3-
/* eslint-disable import/no-nodejs-modules */
43
const fs = require( 'fs' );
54
const path = require( 'path' );
65
const glob = require( 'glob' );

apps/happy-blocks/webpack.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/**
22
* WARNING: No ES6 modules here. Not transpiled!
33
*/
4-
// eslint-disable-next-line import/no-nodejs-modules
54
const { existsSync } = require( 'fs' );
65
const path = require( 'path' );
76
const getBaseWebpackConfig = require( '@automattic/calypso-build/webpack.config.js' );

desktop/test/e2e/specs/login.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-console, import/no-nodejs-modules */
21
const { createWriteStream } = require( 'fs' );
32
const { mkdir } = require( 'fs/promises' );
43
const path = require( 'path' );

packages/calypso-build/bin/calypso-build.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
/**
44
*WARNING: No ES6 modules here. Not transpiled! ****
55
*/
6-
/* eslint-disable import/no-nodejs-modules */
76

87
const fs = require( 'fs' );
98
const path = require( 'path' );

packages/calypso-build/webpack.config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/**
22
* WARNING: No ES6 modules here. Not transpiled! *
33
*/
4-
/* eslint-disable import/no-nodejs-modules */
5-
64
const fs = require( 'fs' );
75
const path = require( 'path' );
86
const process = require( 'process' );

packages/calypso-color-schemes/bin/build-css.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable import/no-nodejs-modules */
21
const { existsSync, mkdirSync, writeFileSync } = require( 'fs' );
32
const { dirname, join } = require( 'path' );
43
const postcss = require( 'postcss' );

packages/calypso-color-schemes/bin/prepare-sass-assets.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable import/no-nodejs-modules */
21
const { copyFileSync, existsSync, mkdirSync } = require( 'fs' );
32
const { basename, dirname, join } = require( 'path' );
43

packages/components/.eslintrc.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ module.exports = {
33
browser: true,
44
},
55
overrides: [
6-
{
7-
files: [ '**/test/**/*' ],
8-
rules: {
9-
'import/no-nodejs-modules': 'off',
10-
},
11-
},
126
{
137
// These are consumed only by Calypso's webpack build, it is ok to import other Calypso components
148
files: [ '**/docs/example.jsx', '*.md.js', '*.md.jsx' ],

packages/generate-password/src/test/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/**
22
* @jest-environment jsdom
33
*/
4-
// eslint-disable-next-line import/no-nodejs-modules
54
import { webcrypto } from 'node:crypto';
65
import { generatePassword, DIGITS, SPECIAL_CHARS, EXTRA_SPECIAL_CHARS } from '../';
76

packages/plans-grid-next/.eslintrc.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ module.exports = {
33
browser: true,
44
},
55
overrides: [
6-
{
7-
files: [ '**/test/**/*' ],
8-
rules: {
9-
'import/no-nodejs-modules': 'off',
10-
},
11-
},
126
{
137
// These are consumed only by Calypso's webpack build, it is ok to import other Calypso components
148
files: [ '**/docs/example.jsx', '*.md.js', '*.md.jsx' ],

packages/verbum-block-editor/bin/build-languages.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable no-console */
2-
/* eslint-disable import/no-nodejs-modules */
31
/**
42
* Build a single language file for each language to `dist/languages` folder.
53
*/

packages/wpcom.js/.eslintrc.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ module.exports = {
2626
// These files use a weird mixture of CJS and ESM. Disabling the rules for now until they can
2727
// get refactored.
2828
'import/default': 'off',
29-
30-
// Test can use Node modules
31-
'import/no-nodejs-modules': 'off',
3229
},
3330
},
3431
],

0 commit comments

Comments
 (0)