Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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.

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
4 changes: 2 additions & 2 deletions bin/plugin/commands/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function formatChangelog( milestone, pullRequests ) {
);
if ( typeGroups[ MISSING_TYPE ] ) {
const prURLs = typeGroups[ MISSING_TYPE ].map(
( { html_url } ) => html_url // eslint-disable-line camelcase
( { html_url } ) => html_url
);
throw new Error(
`The following pull-requests are missing a "${ TYPE_PREFIX }xyz" label: ${ prURLs.join(
Expand Down 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
3 changes: 0 additions & 3 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 Expand Up @@ -90,7 +88,6 @@ async function fetchSchema( schemaUrl ) {

const controller = new AbortController();

// eslint-disable-next-line @wordpress/no-unused-vars-before-return
const timeout = setTimeout( () => controller.abort(), 5000 );

try {
Expand Down
71 changes: 71 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/**
* ESLint flat config (ESLint 8+)
Comment thread
mukeshpanchal27 marked this conversation as resolved.
Outdated
* Based on WordPress coding standards
*/

const importPlugin = require( 'eslint-plugin-import' );
const jsdocPlugin = require( 'eslint-plugin-jsdoc' );

Comment thread
westonruter marked this conversation as resolved.
Outdated
module.exports = [
Comment thread
mukeshpanchal27 marked this conversation as resolved.
{
// Ignore patterns
ignores: [
'vendor/',
'node_modules/',
'build/',
'**/build/**',
'dist/',
'**/*.min.js',
'**/*.min.css',
],
},
{
files: [ '**/*.js' ],
plugins: {
import: importPlugin,
jsdoc: jsdocPlugin,
},
languageOptions: {
Comment thread
westonruter marked this conversation as resolved.
ecmaVersion: 2020,
sourceType: 'module',
globals: {
// Browser
window: 'readonly',
document: 'readonly',
navigator: 'readonly',
console: 'readonly',
// WordPress
wp: 'readonly',
wpApiSettings: 'readonly',
},
},
Comment thread
westonruter marked this conversation as resolved.
rules: {
'jsdoc/valid-types': 'off',
'import/no-unresolved': [
'error',
{
ignore: [ '@octokit/rest' ],
},
],
},
},
Comment thread
westonruter marked this conversation as resolved.
{
files: [ 'plugins/view-transitions/js/**/*.js' ],
plugins: {
jsdoc: jsdocPlugin,
},
rules: {
'jsdoc/no-undefined-types': [
'error',
{
definedTypes: [
'Element',
'PageSwapEvent',
'PageRevealEvent',
'ViewTransition',
],
},
],
},
},
Comment thread
westonruter marked this conversation as resolved.
];
Loading
Loading