Code Monkey home page Code Monkey logo

Comments (5)

daidodo avatar daidodo commented on July 20, 2024

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.

okitan avatar okitan commented on July 20, 2024

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.

daidodo avatar daidodo commented on July 20, 2024

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.

daidodo avatar daidodo commented on July 20, 2024

Please try v7.5.3.

from format-imports-vscode.

okitan avatar okitan commented on July 20, 2024

@daidodo

Thank you for the response.
I updated and confirmed the fix.

Thx!

from format-imports-vscode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.