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 with the correct path #139

Merged
merged 10 commits into from
Nov 29, 2020

Conversation

theoludwig
Copy link
Member

@theoludwig theoludwig commented Nov 26, 2020

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

  • Documentation update
  • Bug fix
  • New feature
  • Other, please explain:

What changes did you make? (Give an overview)

  • Fix: detect brackets in filename by setting newOptions.filename = file with the correct path.
    For example : [id].tsx before the PR, the path was something like that %5Bid%5B.tsx, now it is [id].tsx as it is expected.
    It means custom parser like @typescript-eslint/parser used in ts-standard for example will not complain because the file does not match the project config.
    Thanks to @geospace report!
  • Docs: We can't package the extension with vsce if the README.md contain img src tag with svg (should only be png or jpg). Instead to use the cdn used in the https://github.com/standard/standard README, we use directly the logo in the root folder of this project with the GitHub link.
  • CI: To ensure, we can always package the extension even if the tsc compiles, we run npm run package instead of only npm run compile in the Travis CI. It takes a liitle bit more time but it will not pass when for example we use svg instead of png in README as it was the case in this PR Update README, LICENSE and CHANGELOG + add dependabot #136.
  • Docs: Add 1.4.1 section as pending

Which issue (if any) does this pull request address?

#126

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

Steps to reproduce the issue :

  • git clone https://github.com/standard/vscode-standardjs.git
  • git checkout fix/brackets-filename
  • npm install
  • npm run package
  • code --install-extension vscode-standardjs-1.4.0.vsix
  • Create a new project with ts-standard and typescript as devDependencies and .vscode/settings.json with this content :
{
  "standard.enable": true,
  "standard.engine": "ts-standard",
  "standard.usePackageJson": true
}
  • Create a new file called [id].tsx with this content :
const string = '';
console.log(string)

Hopefully, ts-standard will show you lint errors cause of the semicolon , if it is the case It means the issue has been fixed!

It's working for me as you can see on this screenshot :
Capture1_11

If it's not working, feel free to send your file, with your settings.json and screenshots are always appreciated so we can investigate and try to fix this issue.

Copy link
Member

@feross feross left a comment

Choose a reason for hiding this comment

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

LGTM to me, but I haven't tested the code myself. I'll defer to @LinusU

Also, @divlo we should figure out why your changes keep showing up as modifying the entire file.

@theoludwig
Copy link
Member Author

theoludwig commented Nov 27, 2020

Right, @feross!
I find out why git is always showing big number of changes when I edit some files, for example README, I only edited the logo link nothing else, but still it's like I edited the whole file.

Thanks to this stackoverflow post : Windows ends lines with CRLF, whereas other operating systems end them with LF.

Since I added .editorconfig lately so every time I save a file in VSCode, the ends line converts to LF, it happens on files that the end lines haven't been converted yet.

I simply quote the stackoverflow post : "If your team uses other OSs in addition to Windows: In this case you do want line endings to be normalized. To make it consistent for everyone, put * text=auto in your .gitattributes file."

@theoludwig theoludwig removed the request for review from LinusU November 29, 2020 14:40
@theoludwig theoludwig merged commit 3340002 into master Nov 29, 2020
@theoludwig theoludwig deleted the fix/brackets-filename branch November 29, 2020 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants