Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: have ESLint manage our JSDocs #1746

Merged
merged 9 commits into from
Sep 14, 2020
Merged

Conversation

michaelfig
Copy link
Member

@michaelfig michaelfig commented Sep 12, 2020

This is much stricter ESLint checking for everything that uses it (except for SwingSet, #1749), but still not as strict as we need: gajus/eslint-plugin-jsdoc#637

@michaelfig michaelfig added the Zoe package: Zoe label Sep 12, 2020
@michaelfig michaelfig self-assigned this Sep 12, 2020
Copy link
Contributor

@Chris-Hibbert Chris-Hibbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The zoe javascript changes look good. I don't know enough about the .json or yarn.locak changes to opine.

@michaelfig michaelfig force-pushed the mfig/eslint-jsdoc branch 2 times, most recently from d903d91 to 9e76a9f Compare September 13, 2020 22:51
@michaelfig michaelfig changed the base branch from master to mfig/fix-tests2 September 13, 2020 22:51
Base automatically changed from mfig/fix-tests2 to master September 13, 2020 23:47
@michaelfig michaelfig added hygiene Tidying up around the house tooling repo-wide infrastructure and removed Zoe package: Zoe labels Sep 13, 2020
@michaelfig michaelfig requested review from erights and FUDCo September 14, 2020 01:29
Copy link
Contributor

@FUDCo FUDCo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. How does this relate to #1749?

Copy link
Member

@erights erights left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except for the removal of spaces around the double ampersand. Why? To me it makes the code substantially harder to read.

@@ -189,11 +191,13 @@ function fail(optDetails = details`Assert failed`) {
throw optDetails.complain();
}

/* eslint-disable jsdoc/require-returns-check,jsdoc/valid-types */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The types below failed the linter, mostly due to the incomplete implementation of JSDoc Typescript linting described in #1751.

// @ts-check

import makeStore from '@agoric/store';

/**
* @template T
* @typedef {Object} Device
* @typedef {'Device' & { __deviceType__: T }} Device
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the double underbars?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not strictly necessary, just to remind people not to try actually using d.__deviceType__. Do you have a better suggestion?

@@ -6,10 +6,11 @@
"scripts": {
"build": "exit 0",
"test": "ava",
"lint": "yarn lint:types && eslint '**/*.js'",
"lint": "yarn lint:types&&yarn lint:eslint",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove the spaces around the double ampersand? To me, this is a serious legibility problem.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows experience. Okay, I've reverted that.

packages/zoe/jsconfig.json Show resolved Hide resolved
@michaelfig
Copy link
Member Author

Looks fine. How does this relate to #1749?

Getting SwingSet to pass the linter (#1749) was such a huge change that I expected it would take longer to land than this broader one. So, I decoupled it.

@michaelfig michaelfig merged commit a564c60 into master Sep 14, 2020
@michaelfig michaelfig deleted the mfig/eslint-jsdoc branch September 14, 2020 04:29
Copy link
Contributor

@katelynsills katelynsills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! sorry for the late review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hygiene Tidying up around the house tooling repo-wide infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants