-
Notifications
You must be signed in to change notification settings - Fork 564
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
chore: replace standard and snazzy with neostandard #3485
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? If we are going this way I'd rather go with eslint + prettier.
}), | ||
{ | ||
rules: { | ||
'@stylistic/comma-dangle': ['error', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would love to get feedback on neostandard/neostandard#79 to make this unnecessary 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want, you can update to 0.11.3
now and this override will no longer be needed (though having it will enforce no dangling commas if that's desireable)
eslint.config.js
Outdated
exports: 'never', | ||
functions: 'never' | ||
}], | ||
'@typescript-eslint/no-redeclare': 'off', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this a particular issue with TS-files? Maybe it's something we should tweak in neostandard itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this basically happens if you have something like
export interface CacheStorage {
match (request: RequestInfo, options?: MultiCacheQueryOptions): Promise<Response | undefined>,
has (cacheName: string): Promise<boolean>,
open (cacheName: string): Promise<Cache>,
delete (cacheName: string): Promise<boolean>,
keys (): Promise<string[]>
}
declare const CacheStorage: {
prototype: CacheStorage
new(): CacheStorage
}
Because the interface CacheStorage exists declaring the const CacheStorage results in a no-redeclare linting error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
prettier is incompatible with standard so it would be impossible to do backports. neostandard is just an eslint config and backward compatible with standard. |
I worked now together with @voxpelli regarding this PR, because the linting was quite slow (~10s). Disabling jsx to avoid running react related linting saved 2 s. Also activated eslint cache makes it run significantly faster. So the first run is slow but consecutive runs will have the same perf as before. |
Well. I think the PR is now mature enough for the merge. So if @ronag 's is ok with it, then we could merge it :). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-v6.x v6.x
# Navigate to the new working tree
cd .worktrees/backport-v6.x
# Create a new branch
git switch --create backport-3485-to-v6.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 26004bfccaead3d6ec143c03a09dc036cea2c2ae
# Push it to GitHub
git push --set-upstream origin backport-3485-to-v6.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-v6.x Then, create a pull request where the |
Migrate from standard and snazzyy to neostandard by @voxpelli . Also starting to lint typescript files.
To make it easier to review:
--fix
flag