Skip to content
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

in webstorm terminal can implement error click position #319

Open
3 tasks done
Miofly opened this issue May 15, 2024 · 5 comments
Open
3 tasks done

in webstorm terminal can implement error click position #319

Miofly opened this issue May 15, 2024 · 5 comments

Comments

@Miofly
Copy link

Miofly commented May 15, 2024

Is your feature request related to a problem? Please describe.

example i use vite-plugin-eslint,this plugin output lineNo click can locate the location of the error file
image

Describe the solution you'd like

example i use vite-plugin-eslint,this plugin output lineNo click can locate the location of the error file

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.
@v-bilyavskiy
Copy link

@Miofly
Hi, I'm using a workaround until it's implemented, hope it helps you
add to vite.config.*

const nm: string = path.join(root, 'node_modules');
const loggerFile = path.join(nm, 'vite-plugin-checker', 'dist', 'esm', 'logger.js');

if (await fs.exists(loggerFile)) {
  let source = await fs.readFile(loggerFile, 'utf8');

  if (!source.includes('pathToFileURL')) {
    source = `import { pathToFileURL } from "url";\n${source}`;
  }

  source = source.replace(/(fileLabel ?\+ ?)(d\.id)/, (_m, p1, p2) => `${p1} pathToFileURL(${p2})`);

  await fs.writeFile(loggerFile, source);
}

@Miofly
Copy link
Author

Miofly commented May 17, 2024

@Miofly Hi, I'm using a workaround until it's implemented, hope it helps you add to vite.config.*

const nm: string = path.join(root, 'node_modules');
const loggerFile = path.join(nm, 'vite-plugin-checker', 'dist', 'esm', 'logger.js');

if (await fs.exists(loggerFile)) {
  let source = await fs.readFile(loggerFile, 'utf8');

  if (!source.includes('pathToFileURL')) {
    source = `import { pathToFileURL } from "url";\n${source}`;
  }

  source = source.replace(/(fileLabel ?\+ ?)(d\.id)/, (_m, p1, p2) => `${p1} pathToFileURL(${p2})`);

  await fs.writeFile(loggerFile, source);
}

where is this code executed

@v-bilyavskiy
Copy link

@Miofly
image

@Miofly
Copy link
Author

Miofly commented May 17, 2024

@Miofly image

good, can click jump to file, wait author implemented
image

@rrain0
Copy link

rrain0 commented Jun 4, 2024

@Miofly image

I am getting an error:
ReferenceError: Env is not defined
What is const root: string = Env.PROJECT_ROOT ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants