Comments (4)
The exit code is the number of modified files, (https://github.com/renke/import-sort/blob/master/packages/import-sort-cli/src/index.ts)
Problem is, in Unix system, status code 0 is "Everything is ok", every other status is "There's an error"
#33 should to fix this, but it's a big breaking change, and I don't know if this will be merged.
from import-sort.
@herkulano
--status
, as I understand it, returns the status code, without doing the rewriting (kind of dry-run
), so it's coherent to make it return 0.
For --diff
the work is done, so it's normal to return a status code "everything is ok".
If it fails, it will call bail()
and return -1
from import-sort.
Here's how to suppress the status code when different than 0
:
"fix:sort": "import-sort -o './' || true"
... or run with the silent flag:
$ npm run fix:sort --silent
from import-sort.
@briced for --diff
and --status
it makes senses to exit with 1
as it means they have found errors.
It's only when you're doing --write
or --overwrite
that it shouldn't exit with 1
because the files have been successfully changed, so they should be correct and there are no errors in them. The write command should only exit with 1
if there's an error writing the files.
from import-sort.
Related Issues (20)
- case-insensitive rule in esLintConfig is being ignored (eslint version issue?)
- SyntaxError: Decorators cannot be used to decorate parameters (60:14) HOT 2
- feat: Reference import-sort config file by path HOT 1
- Add support for `import/order` rule from `eslint-plugin-import` for `import-sort-style-eslint`
- Stage 2 decorators cannot be used to decorate parameters
- [Bug] Imports sorting order issue
- [Bug] Integrated lexer fails to properly handle 'abstract' + 'async ' typescript keyword.
- [QUESTION] Is it possible that import-sort automatically remove unused imports ?
- Is this project active anymore? HOT 3
- Error: Cannot find module '@babel/plugin-proposal-do-expressions'
- Integration as an eslint plugin HOT 4
- interleave code between imports
- Combining imports from the same file HOT 2
- Unclear how to set style when using the CLI HOT 2
- Don't Change Destructured Import `__` to `_` HOT 2
- eslint sorting without newline group seperators
- Support TypeScript 4.5
- Breaks TypeScript module declarations
- TypeError: Cannot set properties of undefined (setting 'id')
- Cannot find module 'typescript' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from import-sort.