Comments (5)
Thanks for the feedback!
The plugin uses your local typescript compiler first, or bundled one (v4.9) if not found. My guess is the local TS is too old. Could you check it?
If it's not working, I'd need your plugin logs which can be obtained following instructions in "Debug Mode" in CONTRIBUTION.md.
from format-imports-vscode.
The plugin uses your local typescript compiler first, or bundled one (v4.9) if not found. My guess is the local TS is too old. Could you check it?
I'm using [email protected] and also debug logs show it.
Here is the debug logs:
[2022-12-05T18:09:07.405] [INFO] default - os: {
arch: 'arm64',
platform: 'darwin',
type: 'Darwin',
release: '22.1.0',
totalmem: 25769803776,
freemem: 608043008,
EOL: '\n'
}
[2022-12-05T18:09:07.405] [INFO] default - vscode: { version: '1.73.1' }
[2022-12-05T18:09:14.005] [INFO] vscode.resolveConfig - Resolving config for fileName: /Users/okita.kunio/tmp/pretter/c.ts languageId: typescript
[2022-12-05T18:09:14.007] [DEBUG] format-imports.loadPretConfig - Loading Prettier/EditorConfig config for fileName: /Users/okita.kunio/tmp/pretter/c.ts
[2022-12-05T18:09:14.009] [DEBUG] require-module.requireUserModule - Found prettier in /Users/okita.kunio/tmp/pretter/node_modules/prettier
[2022-12-05T18:09:14.032] [DEBUG] format-imports.loadPretConfig - Prettier API version: 2.8.0
[2022-12-05T18:09:14.037] [DEBUG] format-imports.loadPretConfig - Prettier config: null
[2022-12-05T18:09:14.037] [DEBUG] format-imports.fileConfig - Loading JSON config from import-sorter.json
[2022-12-05T18:09:14.038] [DEBUG] format-imports.packageConfig - Loading package.json config for fileName: /Users/okita.kunio/tmp/pretter/c.ts
[2022-12-05T18:09:14.038] [DEBUG] format-imports.packageConfig - Found package.json in /Users/okita.kunio/tmp/pretter/package.json
[2022-12-05T18:09:14.038] [DEBUG] format-imports.packageConfig - Found package.json /Users/okita.kunio/tmp/pretter/package.json and config: undefined
[2022-12-05T18:09:14.038] [DEBUG] format-imports.enhanceEol - Determining EOL
[2022-12-05T18:09:14.039] [DEBUG] format-imports.formatSourceFromFile - Config: {
configurationFileName: 'import-sorter.json',
autoFormat: 'onSave',
formatExports: true,
exclude: [ 'node_modules' ],
excludeGlob: [],
sortImportsBy: 'paths',
nodeProtocol: 'preserve',
groupRules: [
'^react(-dom)?$',
'^@angular/',
'^vue$',
'^node:',
{},
'^[@]',
'^[.]'
],
sortRules: { paths: [ '_', 'aA' ], names: [ '_', 'aA' ] },
keepUnused: [],
emptyLinesBetweenGroups: 1,
emptyLinesAfterAllImports: 1,
removeLastSlashInPath: false,
removeLastIndexInPath: false,
wrappingStyle: {
maxBindingNamesPerLine: 0,
maxDefaultAndBindingNamesPerLine: 2,
maxExportNamesPerLine: 0,
maxNamesPerWrappedLine: 1,
ignoreComments: false
},
development: { enableDebug: true },
insertFinalNewline: 'preserve',
eol: 'LF',
force: false
}
[2022-12-05T18:09:14.039] [DEBUG] format-imports.formatSourceFromFile - Options: undefined
[2022-12-05T18:09:14.039] [DEBUG] format-imports.loadTsConfig - Loading TS config for fileName: /Users/okita.kunio/tmp/pretter/c.ts from default
[2022-12-05T18:09:14.039] [DEBUG] require-module.requireUserModule - Found typescript in /Users/okita.kunio/tmp/pretter/node_modules/typescript
[2022-12-05T18:09:14.085] [DEBUG] format-imports.loadTsConfig - TypeScript API version: 4.9.3
[2022-12-05T18:09:14.085] [DEBUG] format-imports.loadESLintConfig - Loading ESLint config for fileName: /Users/okita.kunio/tmp/pretter/c.ts from default
[2022-12-05T18:09:14.085] [WARN] require-module.requireModule - Cannot find eslint from path: /Users/okita.kunio/tmp/pretter/c.ts and use default provided
[2022-12-05T18:09:14.085] [DEBUG] format-imports.loadESLintConfig - ESLint API version: 8.28.0
[2022-12-05T18:09:14.093] [WARN] format-imports.loadESLintConfig - Failed to load ESLint config for fileName: /Users/okita.kunio/tmp/pretter/c.ts with error: No ESLint configuration found in /Users/okita.kunio/tmp/pretter.
[2022-12-05T18:09:14.093] [INFO] format-imports.formatSource - Formatting /Users/okita.kunio/tmp/pretter/c.ts with enhanced config: {
configurationFileName: 'import-sorter.json',
autoFormat: 'onSave',
formatExports: true,
exclude: [ 'node_modules' ],
excludeGlob: [],
sortImportsBy: 'paths',
nodeProtocol: 'preserve',
groupRules: [
'^react(-dom)?$',
'^@angular/',
'^vue$',
'^node:',
{},
'^[@]',
'^[.]'
],
sortRules: { paths: [ '_', 'aA' ], names: [ '_', 'aA' ] },
keepUnused: [],
emptyLinesBetweenGroups: 1,
emptyLinesAfterAllImports: 1,
removeLastSlashInPath: false,
removeLastIndexInPath: false,
wrappingStyle: {
maxBindingNamesPerLine: 0,
maxDefaultAndBindingNamesPerLine: 2,
maxExportNamesPerLine: 0,
maxNamesPerWrappedLine: 1,
ignoreComments: false
},
development: { enableDebug: true },
insertFinalNewline: 'preserve',
eol: 'LF',
force: false
}
[2022-12-05T18:09:14.094] [DEBUG] format-imports.formatSource - tsCompilerOptions: undefined
[2022-12-05T18:09:14.094] [DEBUG] format-imports.formatSource - ESLint config processed: undefined
[2022-12-05T18:09:14.094] [DEBUG] format-imports.formatSource - composeConfig: {
maxLength: 80,
wrap: {
withoutDefault: 9007199254740991,
withDefault: 2,
perLine: 1,
exported: 9007199254740991,
parts: true,
skipCmt: false
},
groupSep: '\n\n',
groupEnd: 2,
tab: ' ',
tabw: 2,
quote: [Function (anonymous)],
sComma: '',
mComma: ',',
semi: ';',
bracket: [Function (anonymous)],
lastNewLine: undefined,
nl: '\n'
}
[2022-12-05T18:09:14.110] [INFO] vscode.formatDocument - Finished format
from format-imports-vscode.
Sorry for the late response!
I think it's a bug in TS 4.9.3 that it thinks Fuga
is unused.
I updated to TS 4.9.4 and it works fine.
from format-imports-vscode.
Please try v7.5.3.
from format-imports-vscode.
Thank you for the response.
I updated and confirmed the fix.
Thx!
from format-imports-vscode.
Related Issues (20)
- Suggestion: create usable eslint rule for sorting to validate PRs HOT 1
- Use eslint/prettier/editorconfig configuration for quotemark HOT 4
- Exception: EMFILE: too many open files, open 'd:\Desktop\real project\smartyt\package.json' HOT 1
- Exception: EMFILE: too many open files, open 'c:\Users\Asus\Desktop\AI-Shopping-Assistant\package.json'
- Is there a way to only sort subgroups? HOT 2
- Not preserving "use client" placement at top of page (Next.js) application HOT 2
- Exception: EMFILE: too many open files, open 'c:\project\ffbd-admin\package.json' HOT 1
- Add VS Code extension URL to GitHub repo About section HOT 2
- Always crashing HOT 2
- format import flash HOT 5
- keep imports for commented code HOT 3
- format imports is slow HOT 2
- Empty line added in `.vue` files with no imports HOT 2
- Formatting imports jumps between prettier formatting HOT 17
- ytyyguihiuguigyugiu HOT 1
- Feature Request: Support Svelte
- Sort unassigned imports inline with assigned HOT 3
- Add ability to disable completly line wrapping. HOT 2
- Feature request: Add support for group comments
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 format-imports-vscode.