-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add linting task to check IE compatibility #18774
Conversation
package.json
Outdated
@@ -178,6 +178,7 @@ | |||
"fixtures:generate": "npm run fixtures:server-registered && cross-env GENERATE_MISSING_FIXTURES=y npm run test-unit", | |||
"fixtures:regenerate": "npm run fixtures:clean && npm run fixtures:generate", | |||
"lint": "concurrently \"npm run lint-js\" \"npm run lint-pkg-json\" \"npm run lint-css\" \"npm run lint-types\"", | |||
"lint-es5-only": "npx eslint --parser-options=ecmaVersion:5 --no-eslintrc --no-ignore ./build/**/*.js", |
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.
I think we should inline this into the Travis config. It's not really something developers will run locally and npx
and eslint
are not direct, local dependencies.
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.
Hmm good point. Although in theory devs could use it locally to check if new dependencies are IE-compatible, it'll probably never happen 😁
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.
Noting two things:
npx
here would be redundant anyways, since NPM will include./node_modules/.bin
in thePATH
when running any script. So the line here would work fine (the same) if runningeslint
directly.- If ESLint is not a defined dependency, then we shouldn't have confidence that it would be installed in Travis either. I have a feeling this is only incidentally working because it's some transitive dependency of another package (probably one of the ESLint plugins which are defined as dependencies).
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.
But npx
installs it if it's not there.
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.
But
npx
installs it if it's not there.
Ah, you're right! I always forget that part of it.
Description
Added a script to lint built JS files checking for any ES > 5 that might break on IE11.
Added task to run script in Travis.
How has this been tested?
Tested locally by running
npm run build
followed bynpm run lint-es5-only
. On latest master, no errors should appear.Checking out
69e7fc7060651c65b394944bda00759e232ade33
(or any commit beforehex-rgb
was removed) and re-running the above commands should result in an error traceable to thehex-rgb
package.Screenshots
Types of changes
New feature (non-breaking change which adds functionality)
Checklist: