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

[email protected] #10

Merged
merged 1 commit into from
Oct 20, 2017
Merged

[email protected] #10

merged 1 commit into from
Oct 20, 2017

Conversation

davidchambers
Copy link
Member

I'll add links to the various new rules to make this pull request easier to review. :)

@davidchambers davidchambers requested a review from Avaq August 22, 2017 22:32
@@ -9,6 +9,7 @@
"dot-location": ["property"],
"eol-last": ["always"],
"eqeqeq": ["always", {"null": "never"}],
"for-direction": [],
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Just out of curiosity, why disable this rule in common, and enable it in es3 and es6?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's not actually the case:

eslint-%.json: eslint-%-only.json eslint-common.json scripts/eslint-combine
	scripts/eslint-combine eslint-common.json '$<' >'$@'

Running make updates both derived files based on changes to eslint-common.json. The script which combines the common rules and the ES3/ES6 rules sets the level to "error" in all cases, to save us from having to specify it for every rule. :)

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I see. :)

I'm using eslint's built-in extension capability to share rules between configurations in the config I maintain, as opposed to a build process. Any reason to favour the build option?

Copy link
Member Author

Choose a reason for hiding this comment

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

Any reason to favour the build option?

This project predates ESLint's extension mechanism, which was added fairly recently. I'll investigate the possibility of using extends here. Thanks for the suggestion!

Copy link
Member Author

Choose a reason for hiding this comment

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

We're now using extends. How do the changes look, Aldwin?

@@ -63,20 +64,24 @@
"no-useless-escape": [],
"no-whitespace-before-property": [],
"no-with": [],
"object-curly-newline": [{"consistent": true}],
Copy link
Member Author

Choose a reason for hiding this comment

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

"object-curly-spacing": ["never"],
"object-property-newline": [{"allowMultiplePropertiesPerLine": true}],
"operator-assignment": ["always"],
"padded-blocks": ["never"],
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed this rule when I discovered that it flags this code:

  (function(f) {
>>
    'use strict';

    /* istanbul ignore else */
    if (typeof module === 'object' && typeof module.exports === 'object') {
      module.exports = f(require('sanctuary-type-classes'));
    } else if (typeof define === 'function' && define.amd != null) {
      define(['sanctuary-type-classes'], f);
    } else {
      self.sanctuaryIdentity = f(self.sanctuaryTypeClasses);
    }
>>
  }(function(Z) {
>>
    'use strict';

    ...
>>
  }));

"quotes": ["single", {"avoidEscape": true}],
"radix": ["always"],
"semi": ["always", {"omitLastInOneLineBlock": false}],
"semi-spacing": [{"before": false, "after": true}],
"semi-style": ["last"],
Copy link
Member Author

Choose a reason for hiding this comment

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

"space-before-blocks": ["always"],
"space-before-function-paren": [{"anonymous": "never", "named": "never"}],
"space-in-parens": ["never", {"exceptions": []}],
"space-infix-ops": [],
"space-unary-ops": [{"words": true, "nonwords": false, "overrides": {}}],
"spaced-comment": ["always", {"line": {"markers": ["#", "."], "exceptions": ["."]}}],
"strict": ["safe"],
"switch-colon-spacing": [{"before": false, "after": true}],
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@Avaq Avaq left a comment

Choose a reason for hiding this comment

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

Looks good to me

@davidchambers davidchambers merged commit 33a203a into master Oct 20, 2017
@davidchambers davidchambers deleted the davidchambers/eslint branch October 20, 2017 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants