Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions .eslintrc.js

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/js-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- '.github/workflows/js-lint.yml'
- '**.js'
- '**.json'
- '.eslint*'
- 'eslint.config.*'
- '.nvmrc'
- '.wp-env.json'
- '**/package.json'
Expand All @@ -21,7 +21,7 @@ on:
- '.github/workflows/js-lint.yml'
- '**.js'
- '**.json'
- '.eslint*'
- 'eslint.config.*'
- '.nvmrc'
- '.wp-env.json'
- '**/package.json'
Expand Down
2 changes: 1 addition & 1 deletion bin/plugin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const catchException = ( /** @type {Function} */ handler ) => {
} catch ( error ) {
const message =
error instanceof Error ? error.message : 'Unknown error';
console.error( formats.error( message ) ); // eslint-disable-line no-console
console.error( formats.error( message ) );
process.exitCode = 1;
}
};
Expand Down
2 changes: 1 addition & 1 deletion bin/plugin/commands/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ function formatChangelog( milestone, pullRequests ) {
// Add trailing period.
.replace( /\s*\.?$/, '' )
.concat( '.' );
return `* ${ title } ([${ issue.number }](${ issue.html_url }))`; // eslint-disable-line camelcase
return `* ${ title } ([${ issue.number }](${ issue.html_url }))`;
} )
.filter( Boolean )
.sort()
Expand Down
2 changes: 1 addition & 1 deletion bin/plugin/lib/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const error = createStyledText( 'red' );
const warning = createStyledText( 'yellowBright' );
const success = createStyledText( 'green' );

const log = console.log; // eslint-disable-line no-console
const log = console.log;

module.exports = {
log,
Expand Down
2 changes: 0 additions & 2 deletions bin/validate-json.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env node

/* eslint-disable no-console */

/**
* External dependencies
*/
Expand Down
60 changes: 60 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/**
* ESLint flat config.
*
* Extends the shared configuration shipped with `@wordpress/scripts` (which is
* based on the WordPress coding standards) and layers the project-specific
* tweaks on top.
*/

/**
* External dependencies
*/
const globals = require( 'globals' );
// @ts-ignore -- No declaration file for this module.
const wpScriptsConfig = require( '@wordpress/scripts/config/eslint.config.cjs' );

module.exports = [
Comment thread
mukeshpanchal27 marked this conversation as resolved.
...wpScriptsConfig,
{
// Ignore patterns in addition to those provided by @wordpress/scripts.
ignores: [ 'dist/', '**/*.min.js' ],
},
{
// Browser globals for client-side scripts (everything but the Node tooling below).
files: [ '**/*.js' ],
ignores: [ 'bin/**', '*.config.js' ],
languageOptions: {
globals: {
...globals.browser,
},
},
},
{
// Node-based build tooling and CLI scripts (CommonJS).
files: [ 'bin/**/*.js', '*.config.js' ],
languageOptions: {
Comment thread
westonruter marked this conversation as resolved.
sourceType: 'commonjs',
globals: {
...globals.node,
},
},
Comment thread
westonruter marked this conversation as resolved.
rules: {
'no-console': 'off',
},
},
Comment thread
westonruter marked this conversation as resolved.
{
files: [ '**/*.js' ],
rules: {
'jsdoc/valid-types': 'off',
'import/no-unresolved': [
'error',
{
// `@octokit/rest` is an ESM-only package referenced solely from
// JSDoc `@typedef` imports in `bin/plugin`, which the import
// resolver cannot follow.
ignore: [ '@octokit/rest' ],
},
],
},
},
Comment thread
westonruter marked this conversation as resolved.
];
Loading
Loading