-
Notifications
You must be signed in to change notification settings - Fork 27.4k
chore(*): switch from JSHint/JSCS to ESLint (+ other build-related changes) #14952
Conversation
"accessor-pairs": "error", | ||
"array-callback-return": "error", | ||
"complexity": ["warn", 10], | ||
// "dot-notation": "error", // TODO enable? |
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 there are places where we deliberately use bracket-notation. If there are many such places (that need a "manual" override), I would leave this disabled.
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 was thinking about moving all those TODO
rules to a separate
.eslintrc-todo.json file, then discuss all the options, remove the one we
don't want to enable and the rest will stay there, waiting for someone to
fix the code and enable the rule.
Thoughts?
On Tue, Jul 26, 2016 at 1:32 PM, Georgios Kalpakas <[email protected]
wrote:
In .eslintrc.json
#14952 (comment):
- "no-irregular-whitespace": "error",
- "no-negated-in-lhs": "error",
- "no-obj-calls": "error",
- "no-regex-spaces": "error",
- "no-sparse-arrays": "error",
- "no-unreachable": "error",
- "use-isnan": "error",
- "no-unsafe-finally": "error",
- "valid-typeof": "error",
- "no-unexpected-multiline": "error",
- // Best practices
- "accessor-pairs": "error",
- "array-callback-return": "error",
- "complexity": ["warn", 10],
+// "dot-notation": "error", // TODO enable?I think there are places where we deliberately use bracket-notation. If
there are many such places (that need a "manual" override), I would leave
this disabled.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/angular/angular.js/pull/14952/files/6f56b890138f16a67b5f61cb2238d75378a76497..22f65cbbbf36f1ae396038f457ca2266f5b52767#r72231300,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABrUnvg_rt1IyxEc7jYUKkY9aFjn3a20ks5qZfBkgaJpZM4JU90D
.
Michał Gołębiowski
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.
SGTM
it('should not sanitize attributes other than src', inject(function($compile, $rootScope) { | ||
/* jshint scripturl:true */ | ||
element = $compile('<img title="{{testUrl}}"></img>')($rootScope); | ||
it('should not sanitize attributes other than src', inject(function($compile, $rootScope) { element = $compile('<img title="{{testUrl}}"></img>')($rootScope); |
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.
Missing newline. (Below too.)
So far, this LGTM 👍 Except where otherwise noted, I like (eventually) enabling the rules marked as |
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
1 similar comment
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
Still LGTM2 😄 |
… packages The Travis build.sh script has to be updated as the previous way of specifying parameters to the code run in Grunt tasks stopped working with the newest Grunt.
The previous version depended on a vulnerable request version. Ref angulargh-14961
This avoids warnings with newer versions of Bower.
If one uses nvm to manage Node.js versions, the .nvmrc file makes `nvm use` switch to the version specified in .nvmrc. There are scripts that invoke it automatically when cd'ing to directories containing .nvmrc so that you never run build commands using a wrong Node version, see: https://github.com/creationix/nvm/blob/v0.31.2/README.markdown#zsh
The engineStrict field is deprecated in npm 2 and removed in npm 3.
The "licenses" field is deprecated in favor of the "license" field... which we already have specified.
Partially cherry-picked from c322032 Ref angular#14952
All commits except the ESLint one backported to |
Partially cherry-picked from c322032 Ref angular#14952
Partially cherry-picked from c322032 Ref angular#14952
Partially cherry-picked from c322032 Ref angular#14952
Related to angular#14952. Fixed the following warnings/errors: 1. **Warning**: Closure Compiler complained about `/* @this */` (annotations in non-JSDoc cooments). Fixed by changing `/* @this */` to `/** @this */`. 2. **Warning**: Dgeni complaines about `/** @this */` (invalid tags found). Fixed by adding an empty `this` tag definition in `docs/config/tag-defs/`. 3. **Error**: ESLint complained about CRLF linebreaks in `build/docs/examples/`. These are generated by dgeni and (apparently) use the system's default linebreak (i.e. CRLF on Windows). Fixed by disabling the `linebreak-style` rule for `build/docs/examples/`.
This is a followup to the migration to ESLint. Ref angular#14952
This is a followup to the migration to ESLint. Ref angular#14952
Related to #14952. Fixed the following warnings/errors: 1. **Warning**: Closure Compiler complained about `/* @this */` (annotations in non-JSDoc comments). Fixed by changing `/* @this */` to `/** @this */`. 2. **Warning**: Dgeni complained about `/** @this */` (invalid tags found). Fixed by adding an empty `this` tag definition in `docs/config/tag-defs/`. 3. **Error**: ESLint complained about CRLF linebreaks in `build/docs/examples/`. These are generated by dgeni and (apparently) use the system's default linebreak (e.g. CRLF on Windows). Fixed by disabling the `linebreak-style` rule for `build/docs/examples/`. Closes #14997
Related to #14952. Fixed the following warnings/errors: 1. **Warning**: Closure Compiler complained about `/* @this */` (annotations in non-JSDoc comments). Fixed by changing `/* @this */` to `/** @this */`. 2. **Warning**: Dgeni complained about `/** @this */` (invalid tags found). Fixed by adding an empty `this` tag definition in `docs/config/tag-defs/`. 3. **Error**: ESLint complained about CRLF linebreaks in `build/docs/examples/`. These are generated by dgeni and (apparently) use the system's default linebreak (e.g. CRLF on Windows). Fixed by disabling the `linebreak-style` rule for `build/docs/examples/`. Closes #14997
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
A build-related refactor.
What is the current behavior? (You can also link to an open issue here)
Code is linted via JSHint+JSCS.
What is the new behavior (if this is a feature change)?
Code is linted via ESLint.
Does this PR introduce a breaking change?
No
Please check if the PR fulfills these requirements
Tests for the changes have been added (for bug fixes / features)Docs have been added / updated (for bug fixes / features)Other information:
This is not ready (there are still many ESLint violations) but since the changes are rather large, I'd like to get some feedback now.
There are a couple of build-related commits; submitting them as separate PRs would be difficult as they modify
package.json
and shrinkwrap file. It makes sense to land them separately and all but the last commit are small so it shouldn't case lots of problems in reviewing.