linting between pre-commit and package.json is inconsistent
See original GitHub issueObserved behavior
mentioned by @rtibbles:
our frontend linting commands in our package.json don’t match the way we do linting in our pre-commit hooks/travis linting. Would be good to update those if possible.
There was an update you had made to the build tools Javascript which was getting linted by travis, but doesn’t get linted by default by our package.json commands.
Expected behavior
linting when running devserver should be consistent with pre-commit
, which is used by travis
User-facing consequences
devs think PRs are good but they turn out not to be
Steps to reproduce
make a change to build tools. This will be linted by pre-commit
but not the devserver
Context
0.14
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Using lint-staged, husky, and pre-commit hooks to fail fast and ...
json . In the multi-package repo we have a single linting config set up in the root package, with its rules applied across...
Read more >Automate and Keep Your Code Consistent Using ESLint ...
Lint -Staged — is used to run linter to staged git files and prevent from committing the buggy code. Husky — is a...
Read more >Diving into Husky and Lint-staged | Laurie on Tech
The commands you configure will run "pre-commit". As you're attempting to commit files to your project you'll see ESLint run in your terminal....
Read more >Code consistency with ESLint and Husky - orangejellyfish
With Husky you can configure git hooks in your package.json file. For example, to define a pre-commit hook that runs our ESLint command...
Read more >Pre-Commit Hooks for Pretter and ESLint in TypeScript Projects
Configuring Pre-commit Hooks for Prettier and Linting on a TypeScript Project. How to enforce code styles with Prettier and ESLint.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think I slightly misled @DXCanas here by failing to mention the linting role of flake8 during our conversation, so that’s my fault!
Except that flake8 is also auto-formatting files, so it does have some overlap with black’s role.
Fairly sure that flake8 doesn’t modify import ordering, that’s this hook: https://github.com/learningequality/kolibri/blob/develop/.pre-commit-config.yaml#L16
I think the issue that @DXCanas is raising is if flake8 is also modifying files, then we should stop it doing that and let black handle that.