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

Detect brackets in filename #126

Merged
merged 3 commits into from
Nov 17, 2020
Merged

Detect brackets in filename #126

merged 3 commits into from
Nov 17, 2020

Conversation

yuan9090
Copy link
Contributor

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[X] Bug fix
[X] New feature
[ ] Other, please explain:

What changes did you make? (Give an overview)
Can Detect brackets in filename.

Which issue (if any) does this pull request address?
fix #102 vscode-eslint#977

Is there anything you'd like reviewers to focus on?

Copy link
Member

@theoludwig theoludwig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, it solves the issue, I tested it manually on my computer and resolved the conflicts.
We can now have linting in files like [test].js.
Well done! @yuan9090

Since it's a bug fix and not a big change, I guess we can directy merge to master, if it was a feature request or something bigger, I would rather to have 2 approvals.

@theoludwig theoludwig added the bug label Nov 17, 2020
@theoludwig theoludwig merged commit df9014a into standard:master Nov 17, 2020
@welcome
Copy link

welcome bot commented Nov 17, 2020

🎉 Congrats on getting your first pull request landed!

@edgarjs
Copy link

edgarjs commented Nov 17, 2020

Thank you @yuan9090 !

@divlo how is the release process for the extension? Should it get automatically updated or do I need to re-install it? I'm still new to vscode.

@feross
Copy link
Member

feross commented Nov 17, 2020

@edgarjs We plan to release a new version as soon as the code on master has been tested by a few users since we've had a lot of code changes since the last release.

If you want to help out, can you test the code on master and report if it works for you? Post here: #135

@edgarjs
Copy link

edgarjs commented Nov 17, 2020

@feross Thank you. It works!

Screen Shot 2020-11-17 at 17 47 12

@lucas-santoni
Copy link

lucas-santoni commented Nov 22, 2020

I originally noticed the same issue in version 1.4.0.

I tried master after this patch was merged and I observed the following message:

{
	"resource": "/Users/geo/Documents/code/dessert-frontend/pages/module/[id].tsx",
	"owner": "standard",
	"severity": 8,
	"message": "Parsing error: \"parserOptions.project\" has been set for @typescript-eslint/parser.\nThe file does not match your project config: pages/module/%5Bid%5D.tsx.\nThe file must be included in at least one of the projects provided.",
	"source": "ts-standard",
	"startLineNumber": 1,
	"startColumn": 1,
	"endLineNumber": 1,
	"endColumn": 1
}

I'm working with a Next.js project. I'm using ts-standard@9.0.0 The file I'm working with is named [id].tsx.

Running ts-standard outside VSCode works as expected.

@theoludwig
Copy link
Member

theoludwig commented Nov 23, 2020

@geospace Thanks for your report, we'll try to fix this!
Where does this message appear ?
Could you copy/paste your settings.json (I mean standard extension related settings) there ?

@lucas-santoni
Copy link

This message appears in VSCode's "PROBLEMS" section. See here:

image

It only appears for files such as [id].tsx or [slug].tsx. Here are my vscode-standardjs extension settings:

  "standard.engine": "ts-standard",
  "standard.autoFixOnSave": true,
  "standard.usePackageJson": true,

Just in case, my complete settings.json file is available here.

Here is package.json:

{
  "name": "front",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "ts-standard --fix"
  },
  "dependencies": {
    "@apollo/client": "^3.2.7",
    "github-markdown-css": "^4.0.0",
    "graphql": "^15.4.0",
    "lodash": "^4.17.20",
    "mobile-detect": "^1.4.4",
    "next": "^10.0.2",
    "normalize.css": "^8.0.1",
    "react": "17.0.1",
    "react-dom": "17.0.1",
    "react-grid-system": "^7.1.1",
    "react-icons": "^3.10.0",
    "react-infinite-scroll-component": "^5.1.0",
    "react-markdown": "^5.0.3",
    "react-select": "^3.1.0",
    "react-toastify": "^6.1.0"
  },
  "devDependencies": {
    "@types/lodash": "^4.14.165",
    "@types/node": "^14.14.9",
    "@types/react": "^17.0.0",
    "@types/react-dom": "^17.0.0",
    "@types/react-select": "^3.0.26",
    "@types/webpack": "^4.41.25",
    "gray-matter": "^4.0.2",
    "next-mdx-remote": "^1.0.0",
    "ts-standard": "^9.0.0",
    "typescript": "4.0.5"
  },
  "ts-standard": {
    "ignore": [
      "next-env.d.ts"
    ]
  }
}

And here is tsconfig.json:

{
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": false,
    "skipLibCheck": false,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve"
  },
  "exclude": ["node_modules"],
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
}

Let me know if I can do anything else to help you debug this! I'll try to dig a bit more myself over the weekend or at least create a minimal repository that reproduces the issue.

@theoludwig
Copy link
Member

theoludwig commented Nov 26, 2020

Indeed, I find out how to reproduce. I had a hard time fixing the issue but hopefully it is now fine.
Could you tell me if #139 fix the issue ? @geospace (maybe answer if it is working or not in the #139 PR not on this one)

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

Successfully merging this pull request may close these issues.

Paths with a [ and/or ] in them are ignored
5 participants