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

Look into a config file for using http://stylelint.io/ #13

Closed
andykenward opened this issue Feb 15, 2016 · 10 comments
Closed

Look into a config file for using http://stylelint.io/ #13

andykenward opened this issue Feb 15, 2016 · 10 comments

Comments

@andykenward
Copy link

Would be great to have a shared config file for stylelint.io with these rules.

It is written in JavaScript vs scss-lint that relies on Ruby.

Article about it

@gaurav21r
Copy link

+1 👍

@timothyneiljohnson
Copy link

+1 👍

@ljharb
Copy link
Collaborator

ljharb commented Mar 23, 2016

@timothyneiljohnson Now that Github has reactions, please use those to +1 in the future instead of adding comment noise. Thanks!

@ntwb
Copy link

ntwb commented Jun 5, 2016

From the README.md

  1. CSS
    • Formatting
      • Use soft tabs (2 spaces) for indentation: 'indentation': 2,
      • Do not use ID selectors: 'selector-no-id': true,
      • When using multiple selectors in a rule declaration, give each selector its own line: 'selector-list-comma-newline-after': 'always',
      • Put a space before the opening brace { in rule declarations: 'block-opening-brace-space-before': 'always',
      • In properties, put a space after, but not before, the : character: 'declaration-colon-space-after': 'always', and 'declaration-colon-space-before': 'never',
      • Put closing braces } of rule declarations on a new line: 'block-closing-brace-newline-before': 'always',
      • Put blank lines between rule declarations: 'rule-non-nested-empty-line-before': ['always', { ignore: ['after-comment'], }],
    • Comments
      • Prefer line comments (// in Sass-land) to block comments.
        • CSS: 'no-invalid-double-slash-comments': true, Ignored in Sass-land
      • Prefer comments on their own line. Avoid end-of-line comments: 'comment-empty-line-before': ['always', {ignore: ['stylelint-commands'],}],
      • Write detailed comments for code that isn't self-documenting:
        • Uses of z-index: n/a
        • Compatibility or browser-specific hacks: you might want to use no-browser-hacks rule with the warning severity
    • OOCSS and BEM
    • Border
  2. Sass
  3. Not Implemented for CSS formatting:
    • Prefer dashes over camelCasing in class names. Underscores and PascalCasing are okay if you are using BEM (see OOCSS and BEM below), use selector-class-pattern with a regular expression matching your pattern
  4. Suggestions, I've deliberately left out many rules and only covered as much as I could the Airbnb CSS / Sass Styleguide as it is written, I'd suggest reviewing these for additional rules:

@ai
Copy link

ai commented Aug 30, 2016

@lencioni Stylelint is already used by:

Using Stylelint is especially reasonable, because Stylelint copy ESLint architecture. If you like ESLint, you will love Stylelint too — same benefits.

@michaelBenin
Copy link

Hello, there hasn't been much action in this thread and I'm hoping to revive it. Is airbnb open to a pr for this?

@ai
Copy link

ai commented Dec 5, 2016

Stylelint become the most popular CSS linter from npm: http://www.npmtrends.com/csslint-vs-csscomb-vs-stylelint

@ljharb
Copy link
Collaborator

ljharb commented Dec 5, 2016

@michaelBenin yes, as long as it includes the right travis config so that it can be automatically verified :-)

@ntwb
Copy link

ntwb commented Dec 5, 2016

@michaelBenin The pull request is in #23, I'm happy to refresh it, update, add whatever Travis CI configuration is needed etc

@andykenward
Copy link
Author

Going to close this as its been a few years.

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

No branches or pull requests

7 participants