-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Add fix/lint helper dev targets #23561
Conversation
This pull request has merge conflicts that must be resolved before it can be merged. |
820e22c
to
3d85b6c
Compare
This pull request has merge conflicts that must be resolved before it can be merged. |
3d85b6c
to
105e480
Compare
105e480
to
f2332de
Compare
I updated this to include Markdown targets after #21972 landed, but realized I missed a trigger there, so added in a slightly unrelated commit to fix that |
If there is a preference to go with the shorter names like in #23920 I can flatter them down to |
package.json
Outdated
"start": "node ./streaming/index.js", | ||
"test": "${npm_execpath} run test:lint:js && ${npm_execpath} run test:jest", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason you are replacing ${npm_execpath}
with yarn
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wasn't a pattern I had come across before, and didn't seem to be cross-platform compatible as it relies on bash shell expansion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think &&
is cross platform in the first place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
&&
is cross platform. Here is a litte example, first run I cut short, but run on this branch, then switched back to main
show the error
PS Z:\mastodon> yarn --version
1.22.19
PS Z:\mastodon> yarn lint
yarn run v1.22.19
$ yarn lint:js && yarn lint:json && yarn lint:sass && yarn lint:yml
$ eslint . --ext .js,.jsx --cache --report-unused-disable-directives
Z:\mastodon\app\javascript\mastodon\components\status.jsx
517:13 warning Avoid non-native interactive elements. If using native HTML is not possible, add an appropriate role and support for tabbing, mouse, keyboard, and touch inputs to an interactive content element jsx-a11y/no-static-element-interactions
✖ 1 problem (0 errors, 1 warning)
$ prettier --check "**/*.json"
Checking formatting...
All matched files use Prettier code style!
$ stylelint "**/*.{css,scss}" && prettier --check "**/*.{css,scss}"
PS Z:\mastodon> yarn test:lint
yarn run v1.22.19
$ ${npm_execpath} run test:lint:js && ${npm_execpath} run test:lint:sass
'${npm_execpath}' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
PS Z:\mastodon>
Same with gitbash on windows
$ yarn test:lint
yarn run v1.22.19
$ ${npm_execpath} run test:lint:js && ${npm_execpath} run test:lint:sass
'${npm_execpath}' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
152356c
to
7ca8ba6
Compare
I flattened out the target names to just |
@ykzts any more concerns with this one? |
This pull request has merge conflicts that must be resolved before it can be merged. |
This pull request has resolved merge conflicts and is ready for review. |
I updated the js-linting CI to call the |
This pull request has merge conflicts that must be resolved before it can be merged. |
This pull request has resolved merge conflicts and is ready for review. |
This pull request has merge conflicts that must be resolved before it can be merged. |
This pull request has resolved merge conflicts and is ready for review. |
This pull request has merge conflicts that must be resolved before it can be merged. |
This pull request has resolved merge conflicts and is ready for review. |
ESLint and Stylelint both allow a
--fix
parameter to autofix rules, but things like Prettier use another--write
command.This adds consistent targets so developers can use the tool's autofixing easily, along with a rollup
yarn fix
to run all autofixes.