Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
npm-debug.log
node_modules/
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Wizeline Javascript Style Guide
Wizeline's ESLint rules for js environments

## Installation
First, install ESLint as a dev dependency

``` npm install --save-dev eslint ```

Then, install Wizeline's lintern configs

``` npm install --save-dev wizeline/eslint-config-wizeline ```

Finally, add the required peer dependencies. You will be warned after running the above command.

## Usage
These configs are divided by environments. Use the one you need for your project.

For example, if you're working with a browser-related stack, you will need to add the following to your project's `.eslintrc`

```json
{
"extends": "eslint-config-wizeline/browser"
}
```
27 changes: 27 additions & 0 deletions base/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = {
"extends": "eslint:recommended",
"env": {
"es6": true,
"node": true
},
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true
},
"sourceType": "module"
},
"rules": {
"comma-dangle": ["error", "always-multiline"],
"indent": ["error", 2, { "SwitchCase": 1 }],
"keyword-spacing": "error",
"object-curly-spacing": ["error", "always"],
"no-multiple-empty-lines": ["error", { "max": 1 }],
"linebreak-style": ["error", "unix"],
"max-len": ["error", 120, 4, { "ignoreUrls": true }],
"no-param-reassign": ["error", { "props": false }],
"quotes": ["error", "single"],
"semi": ["error", "always"],
"strict": ["error", "never"],
"require-yield": "off"
}
};
21 changes: 21 additions & 0 deletions browser/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
"extends": "eslint-config-wizeline",
"env": {
"browser": true
},
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
},
"plugins": [
"react",
"flowtype"
],
"rules": {
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react/prefer-stateless-function": "error"
}
};
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./base');
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"description": "",
"main": "index.js",
"peerDependencies": {
"eslint": ">=3"
"eslint": ">=3.19.0",
"eslint-plugin-react": ">=6.0.0",
"eslint-plugin-flowtype": ">=2.30.2",
"babel-eslint": ">=7.1.1"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down