Make WordPress Core

Opened 16 months ago

Last modified 2 months ago

#43828 assigned task (blessed)

Add JSDoc ESLint script

Reported by: netweb Owned by: netweb
Milestone: 5.3 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch needs-testing needs-refresh
Focuses: javascript Cc:


This script seeks to add a JSDoc focused ESLint script to check the JSDocs conformity with the WordPress JavaScript Docs Coding Standards

It will also greatly aid those involved with the JavaScript Inline Docs Initiative to ensure patches are conforming to the coding standards.

To test and use this npm script run, npm install and then npm run lint:jsdoc in the terminal console.

A sister pull request add similar functionality has been in ongoing development in the Gutenberg repo:

The patch for this ticket adds the ESLint JSDoc configuration to a file named .eslintrc-jsdoc.js, this is to avoid conflicts with the work in progress of adding ESLint in #31823

Attachments (3)

43828.diff (2.2 KB) - added by netweb 16 months ago.
43828.2.diff (1.3 MB) - added by kamataryo 2 months ago.
This is refreshed patch to do linting script with @wordpress/scripts
43828.3.diff (1.7 KB) - added by kamataryo 2 months ago.
Fixed the broken patch 43828.2.dff

Download all attachments as: .zip

Change History (12)

16 months ago

#1 @atimmer
16 months ago

  • Keywords has-patch added

This would help a a lot when reviewing patches.

I am thinking, how hard would it be to add a check for the presence of @since?

#2 @netweb
16 months ago

  • Keywords needs-testing added

This patch will need a little more testing to ensure I've excluded, and not errantly omitted any files or folders that we should be checking.

Great idea for @since, I'll take a look around and see what options are available to check that it exists and ensure that it is valid syntax

#3 @jorbin
11 months ago

  • Milestone changed from 5.0 to 5.1

#4 @pento
7 months ago

  • Keywords needs-refresh added
  • Milestone changed from 5.1 to 5.2

#5 @jorbin
5 months ago

  • Milestone changed from 5.2 to 5.3

Bumping this from 5.2 due to lack of progress

This ticket was mentioned in Slack in #core-js by kamataryo. View the logs.

2 months ago

#7 @kamataryo
2 months ago

Probably we should refresh the patch with [@wordpress/scripts](https://github.com/WordPress/gutenberg/tree/master/packages/scripts), which includes wp-scripts lint-js.

2 months ago

This is refreshed patch to do linting script with @wordpress/scripts

2 months ago

Fixed the broken patch 43828.2.dff

#8 @kamataryo
2 months ago

Sorry to upload 43828.2.diff which is broken and not svn diff.
43828.3.diff should be the minimum required one.

#9 @kamataryo
2 months ago

The patch 43828.3.diff includes:

  • inherit .eslintignore from the existing 43828.diff patch and match it current status
  • inherit .eslingrc.js from the existing 43828.diff patch
  • package.json update to set @wordpress/scripts as a dependency
  • Also npm scripts npm run lint:js is added to run it
Note: See TracTickets for help on using tickets.