Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cjpatoilo/eslint-config-styled
ESLint shareable config for JavaScript Styled.
https://github.com/cjpatoilo/eslint-config-styled
eslint eslint-config javascript style-guide
Last synced: 4 months ago
JSON representation
ESLint shareable config for JavaScript Styled.
- Host: GitHub
- URL: https://github.com/cjpatoilo/eslint-config-styled
- Owner: cjpatoilo
- License: mit
- Created: 2017-01-02T06:32:12.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2023-02-27T01:31:08.000Z (almost 2 years ago)
- Last Synced: 2024-10-16T07:23:56.851Z (4 months ago)
- Topics: eslint, eslint-config, javascript, style-guide
- Language: JavaScript
- Homepage: https://github.com/cjpatoilo/eslint-config-styled
- Size: 69.3 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Contributing: .github/contributing.md
- License: license
Awesome Lists containing this project
README
# JavaScript Styled
> ESLint shareable config for JavaScript Styled.
[](https://travis-ci.org/cjpatoilo/eslint-config-styled?branch=master)
[](https://ci.appveyor.com/project/cjpatoilo/eslint-config-styled)
[](https://www.codacy.com/app/cjpatoilo/eslint-config-styled/dashboard)
[](https://david-dm.org/cjpatoilo/eslint-config-styled)
[](https://www.npmjs.com/package/eslint-config-styled)
[](https://www.npmjs.com/package/eslint-config-styled)
[](https://gitter.im/cjpatoilo/eslint-config-styled)## Install
```
$ npm install --save-dev eslint-config-styled
```## Usage
Add some ESLint config to your `.eslintrc`:
```
{
"extends": "styled"
}
```Or to command line options:
```
eslint --config=styled
```Or to `package.json`:
```
{
"name": "my-project",
"eslintConfig": {
"extends": "styled"
}
}
```## Rules
- No semicolons.
- No unused variables.
- Use tab for indentation.
- Use `===` instead of `==`.
- Use single quotes for strings except to avoid escaping.
- Add a space after keywords.
- Add a space before a function declaration's parentheses.
- Infix operators must be spaced.
- Commas should have a space after them.
- Keep else statements on the same line as their curly braces.
- For multi-line if statements, use curly braces.
- Always handle the `err` function parameter.
- Always prefix browser globals with `window.`.
- Multiple blank lines not allowed.
- For the ternary operator in a multi-line setting, place `?` and `:` on their own lines.
- For var declarations, write each declaration in its own statement.
- Wrap conditional assignments with additional parentheses. This makes it clear that the expression is intentionally an assignment (`=`) rather than a typo for equality (`===`).*NOTE: The best way to learn about that is to just install it and give it a try on your code.*
## Contributing
Want to contribute? Follow these [recommendations](https://github.com/cjpatoilo/eslint-config-styled/blob/master/.github/contributing.md).
## License
Designed with ♥ by [CJ Patoilo](https://twitter.com/cjpatoilo). Licensed under the [MIT License](https://cjpatoilo.mit-license.org).