WordPress.org

Make WordPress Core

Opened 20 months ago

Last modified 2 months ago

#43828 assigned task (blessed)

Add JSDoc ESLint script

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

Description

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 20 months ago.
43828.2.diff (1.3 MB) - added by kamataryo 6 months ago.
This is refreshed patch to do linting script with @wordpress/scripts
43828.3.diff (1.7 KB) - added by kamataryo 6 months ago.
Fixed the broken patch 43828.2.dff

Download all attachments as: .zip

Change History (15)

@netweb
20 months ago

#1 @atimmer
20 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
20 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
14 months ago

  • Milestone changed from 5.0 to 5.1

#4 @pento
11 months ago

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

#5 @jorbin
8 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.


6 months ago

#7 @kamataryo
6 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.

@kamataryo
6 months ago

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

@kamataryo
6 months ago

Fixed the broken patch 43828.2.dff

#8 @kamataryo
6 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
6 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

#10 @netweb
2 months ago

Thanks @kamataryo, sorry I've not replied sooner, I'll take a look at the latest 43828.3.diff patch shortly

#11 @netweb
2 months ago

  • Milestone changed from 5.3 to 5.4

Punting this to 5.4 to help clear the 5.3 milestone

This ticket was mentioned in Slack in #core by peterwilsoncc. View the logs.


2 months ago

Note: See TracTickets for help on using tickets.