Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oberonamsterdam/eslint-config-oberon
Oberon's default eslint config.
https://github.com/oberonamsterdam/eslint-config-oberon
Last synced: about 2 months ago
JSON representation
Oberon's default eslint config.
- Host: GitHub
- URL: https://github.com/oberonamsterdam/eslint-config-oberon
- Owner: oberonamsterdam
- License: mit
- Created: 2017-04-03T13:27:36.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T11:31:09.000Z (almost 2 years ago)
- Last Synced: 2024-10-28T12:52:11.013Z (2 months ago)
- Language: JavaScript
- Homepage: https://oberon.nl
- Size: 177 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Oberon ESLint config & standard
The Oberon javascript code standard & config.
## Codestyle
### The gist
The config consists of a lot of rules, we'll summarize them here, but for the full set, see below.- **Semicolons at the end of each statement.**
- **camelCasing should be used on all object properties.**
- **Always use [curly brace conventions](https://eslint.org/docs/rules/curly).** Even if your block only consists of a single statement.
- **Single quotes are the default.** But use double quotes within JSX.
- **Indents with 4 spaces**, no tabs allowed.
- **Always use === for comparing equality**
- **Don't use var**, use const/let instead.
- **Don't declare multiple variables on a single line.** Except for uninitialized variables.
This is **allowed**:
```js
const a, b, c;
```
This **isn't:**
```js
const a = false, b = true, c = false;
```
- **Console/debugger calls will be marked as warnings.** They should not be added to production code.## Usage
Add a `.eslintrc` file to your project:```json
{
"extends": "oberon"
}
```OR add the following to your project's `package.json`
```json
{
...
"eslintConfig": {
"extends": "oberon"
}
}
```Install eslint & eslint-config-oberon locally (`npm i eslint eslint-config-oberon -D`)
## Commit hook (recommended)
- `npm i lint-staged husky -D`
- Add the following to your `package.json`:
```json
"husky": {
"hooks": {
"pre-commit": "npm run typecheck && lint-staged"
}
}
```