-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Use ESLint on JavaScript #1890
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
base: gh-pages
Are you sure you want to change the base?
Use ESLint on JavaScript #1890
Conversation
✅ Deploy Preview for expressjscom-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
package.json
Outdated
@@ -3,7 +3,7 @@ | |||
"version": "0.0.0", | |||
"private": true, | |||
"scripts": { | |||
"test": "eslint --ignore-path .gitignore --ignore-pattern _includes/readmes/ \"**/*.md\"" | |||
"test": "eslint . --ignore-path .gitignore --ignore-pattern _includes/readmes/ \"**/*.md\"" |
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.
Without the .
, ESLint doesn't actually run on any files.
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.
Hi @bdkopen, thank you for taking up this issue. Overall, the changes looks good! However, I would suggest moving the eslintConfig
section from package.json into a separate file.
I moved the ESLint config into a new file. I responded to your other comments as well. Thanks for reviewing! |
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.
Great, thank you for suggesting those options. Switching to ESLint's default configuration instead of eslint-config-standard
makes sense, and updating ESLint to 9.x in a separate PR is a good approach.
Let's see if other team members have additional suggestions on this approach
I fixed the |
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.
at the very least, we still should have semicolons in code
Sure, I added a rule that overrides the |
oh... I didn't realize there would be so many missing semicolons. to unblock this, what we would ask is to change the configured rules such that the minimal amount of code change via in other words, let's focus this PR so that linting is executing, but let's not change rules/files as part of it. or if that is not possible, which is understandable, this will need to wait till we resolve our future direction on linting |
@ctcpip I dropped the commit enforcing semicolons. Without modifying the lint rules, the linting will remove semicolons in a few files since that is what the This PR can be focused on requiring linting execution as long you're comfortable with enforcing the existing rules. If we don't want to enforce the existing rules, it seems like this PR will be blocked until the direction of linting is determined. |
I think you could make it so that only JavaScript files have semicolons, and markdown files don’t have semicolons. |
@bjohansebas that seems like a good intermediate solution. Updated! |
test
script to run on JS files.browser
andjquery
as environments so their variables are seen as defined.