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
Standardize our npm scripts #14827
Comments
I agree with pretty much all of that. I follow the Ember blueprint, which demonstrates a functional setup for running multiple lint/test scripts in parallel:
In summary:
|
Makes sense to me 👍🏻 |
My thoughts:
|
|
@mdjermanovic Oh, I didn't notice that the Ember blueprint
Agreed with all of that. One more point, I like to ensure unused disable directive comments don't sneak in. Here are different ways to do that:
Any preference? Historically, I've used eslint-plugin-eslint-comments because it has a bunch of other good recommended rules around comment practices. |
We should use the built-in functionality for reporting unused disable directives:
|
Oops! It looks like we lost track of this issue. @eslint/eslint-tsc what do we want to do here? This issue will auto-close in 7 days without an update. |
I think this is a great idea and I'm willing to champion it. I'll do some research and add a comment here that fleshes out @nzakas's proposal and incorporates the suggestions in this thread. If you don't hear from me by August 1 please send me a gentle reminder. :) |
@pmcelhaney much appreciated! |
Here's a list of the current script names and where they're used, generated with this script.
|
Here's a proposed standard which fleshes out @nzakas's original request. ESlint Package Script Naming ConventionsNamesnpm script names MUST contain only lower case letters, Here is a summary of the proposal in EBNF.
OrderThe script names MUST appear in the package.json file in alphabetical order. The other conventions outlined in this document ensure that alphabetical order will coincide with logical groupings. Main Script NamesWith the exception of npm life cycle scripts all script names MUST begin with one of the following names. BuildScripts that generate a set of files from source code and / or data MUST have names that begin with If a package contains any LintScripts that statically analyze files (mostly, but not limited to running If a package contains any If fixing is available, a linter MUST NOT apply fixes UNLESS the script contains the StartA TestScripts that execute code in order to ensure the actual behavior matches expected behavior MUST have names that begin with If a package contains any A test script SHOULD NOT include linting. A test script SHOULD report test coverage when possible. ModifiersOne or more of the following modifiers MAY be appended to the standard script names above. If a target has modifiers, they MUST be in the order in which they appear below (e.g. FixIf it's possible for a linter to fix problems that it finds, add a copy of the script with TargetThe name of the target of the action being run. In the case of a A target MAY refer to a list of affected file extensions (such as The target SHOULD NOT refer to name of the name of the tool that's performing the action ( OptionsAdditional options that don't fit under the other modifiers. WatchIf a script watches the filesystem and responds to changes, add What's next? Does this need to be an RFC? Or can I create a pull request under https://github.com/eslint/eslint/tree/main/docs/src/developer-guide ? Once the standard is agreed upon, I'm happy to start sending PRs to update each of the package.json files and code that references the script names. |
I like the proposal If others agree, I think we can just document it under Developer Guide and then move forward with PRs to other repos. @eslint/eslint-tsc what do you think? |
This is great! Since this isn't an external API, it's easy to change as we learn, so I agree there's no need for an RFC. Thanks @pmcelhaney! |
Marking as accepted. @pmcelhaney please proceed. |
* chore: standardize npm script names per #14827 * put lint:fix right after lint * chore: fix ordering of :fix Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * chore: change release scripts to have "release:" prefix Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> * docs: update package.json naming to include 'release' * docs: add css so abnf code formats okay * chore: exclude linting from npm test * docs: remove counter-reset. I guess that was a merge error Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [eslint](https://eslint.org) ([source](https://github.com/eslint/eslint)) | devDependencies | minor | [`8.29.0` -> `8.30.0`](https://renovatebot.com/diffs/npm/eslint/8.29.0/8.30.0) | --- ### Release Notes <details> <summary>eslint/eslint</summary> ### [`v8.30.0`](https://github.com/eslint/eslint/releases/tag/v8.30.0) [Compare Source](eslint/eslint@v8.29.0...v8.30.0) #### Features - [`075ef2c`](eslint/eslint@075ef2c) feat: add suggestion for no-return-await ([#​16637](eslint/eslint#16637)) (Daniel Bartholomae) - [`7190d98`](eslint/eslint@7190d98) feat: update globals ([#​16654](eslint/eslint#16654)) (Sébastien Règne) #### Bug Fixes - [`1a327aa`](eslint/eslint@1a327aa) fix: Ensure flat config unignores work consistently like eslintrc ([#​16579](eslint/eslint#16579)) (Nicholas C. Zakas) - [`9b8bb72`](eslint/eslint@9b8bb72) fix: autofix recursive functions in no-var ([#​16611](eslint/eslint#16611)) (Milos Djermanovic) #### Documentation - [`6a8cd94`](eslint/eslint@6a8cd94) docs: Clarify Discord info in issue template config ([#​16663](eslint/eslint#16663)) (Nicholas C. Zakas) - [`ad44344`](eslint/eslint@ad44344) docs: CLI documentation standardization ([#​16563](eslint/eslint#16563)) (Ben Perlmutter) - [`293573e`](eslint/eslint@293573e) docs: fix broken line numbers ([#​16606](eslint/eslint#16606)) (Sam Chen) - [`fa2c64b`](eslint/eslint@fa2c64b) docs: use relative links for internal links ([#​16631](eslint/eslint#16631)) (Percy Ma) - [`75276c9`](eslint/eslint@75276c9) docs: reorder options in no-unused-vars ([#​16625](eslint/eslint#16625)) (Milos Djermanovic) - [`7276fe5`](eslint/eslint@7276fe5) docs: Fix anchor in URL ([#​16628](eslint/eslint#16628)) (Karl Horky) - [`6bef135`](eslint/eslint@6bef135) docs: don't apply layouts to html formatter example ([#​16591](eslint/eslint#16591)) (Tanuj Kanti) - [`dfc7ec1`](eslint/eslint@dfc7ec1) docs: Formatters page updates ([#​16566](eslint/eslint#16566)) (Ben Perlmutter) - [`8ba124c`](eslint/eslint@8ba124c) docs: update the `prefer-const` example ([#​16607](eslint/eslint#16607)) (Pavel) - [`e6cb05a`](eslint/eslint@e6cb05a) docs: fix css leaking ([#​16603](eslint/eslint#16603)) (Sam Chen) #### Chores - [`f2c4737`](eslint/eslint@f2c4737) chore: upgrade [@​eslint/eslintrc](https://github.com/eslint/eslintrc)[@​1](https://github.com/1).4.0 ([#​16675](eslint/eslint#16675)) (Milos Djermanovic) - [`ba74253`](eslint/eslint@ba74253) chore: standardize npm script names per [#​14827](eslint/eslint#14827) ([#​16315](eslint/eslint#16315)) (Patrick McElhaney) - [`0d9af4c`](eslint/eslint@0d9af4c) ci: fix npm v9 problem with `file:` ([#​16664](eslint/eslint#16664)) (Milos Djermanovic) - [`90c9219`](eslint/eslint@90c9219) refactor: migrate off deprecated function-style rules in all tests ([#​16618](eslint/eslint#16618)) (Bryan Mishkin) </details> --- ### Configuration📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC43MC40IiwidXBkYXRlZEluVmVyIjoiMzQuNzAuNCJ9--> Co-authored-by: cabr2-bot <cabr2.help@gmail.com> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1689 Reviewed-by: Epsilon_02 <epsilon_02@noreply.codeberg.org> Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org> Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
We have a number of different projects that are using different conventions for various npm scripts. I'd like us to standardize our script names and what they for the following actions:
build
. I think we are doing this everywhere, but wanted to include here for the record.lint
to lint every type of file, and thenlint:*
, where*
is the file extension, for linting just specific types of files (examples:lint:js
,lint:md
).fix
,fixlint
,lint:fix
, and some have no lint fix script at all. I'd like to standardize onlint:fix
, which should run on all file types, or elselint:fix:*
to run just on a subtype.test
runs both linting and testing. In some packages we haveunit:*
scripts and in some we havetest:*
scripts. Some packages have coverage and others do not (test:cover
,coverage
,test-cov
, etc.). I think we should standardize:test
does not includelint
test
always runs with coveragetest:*
. Everytest:*
is run withtest
Thoughts?
The text was updated successfully, but these errors were encountered: