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

The path of "includes" should be relative from dprint.json #71

Open
lazex opened this issue Nov 18, 2023 · 0 comments
Open

The path of "includes" should be relative from dprint.json #71

lazex opened this issue Nov 18, 2023 · 0 comments

Comments

@lazex
Copy link

lazex commented Nov 18, 2023

The folder structure is as follows.

project_root/  <-- Open this folder in vscode
  foo/
    dprint.json
    src/
      index.js

dprint.json is follows.

{
  "typescript": {
  },
  "includes": ["src/**/*.{ts,tsx,js,jsx,cjs,mjs,json}"],
  "excludes": [
    "**/node_modules"
  ],
  "plugins": [
    "https://plugins.dprint.dev/typescript-0.88.3.wasm",
    "https://plugins.dprint.dev/json-0.15.0.wasm"
  ]
}

I want to format the index.js file.

Using CLI, following command formats index.js as expected.

cd project_root/foo
dprint fmt

Using VSCode extension, Shift + Alt + F command does not format index.js.

I tried to change includes path to the relative path from the folder opened in vscode.

  "includes": ["foo/src/**/*.{ts,tsx,js,jsx,cjs,mjs,json}"],

This works.

I think that relative path should be based on location of dprint.json.

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

1 participant