Skip to content

Commit

Permalink
Merge pull request #3 from frsv/master
Browse files Browse the repository at this point in the history
#18 Move to ES6
  • Loading branch information
ai committed Feb 12, 2017
2 parents 90141e4 + b895583 commit ff1fc14
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 27 deletions.
20 changes: 20 additions & 0 deletions README.md
Expand Up @@ -9,16 +9,36 @@ Shareable code style and best practice for [Logux] projects.

## Install

For browser and universal project:

```sh
npm install --save-dev logux-config-logux eslint-config-standard eslint-plugin-promise eslint-plugin-es5 eslint-plugin-standard eslint
```

For server-only project you can use config with ES2015+ support:

```sh
npm install --save-dev logux-config-logux eslint-config-standard eslint-plugin-promise eslint-plugin-node eslint-plugin-standard eslint
```

## Usage

Browser and universal project:

Add to `package.json` or other ESLint config:

```sh
"eslintConfig": {
"extends": "eslint-config-logux"
}
```

Server-only project:

Add to `package.json` or other ESLint config:

```sh
"eslintConfig": {
"extends": "eslint-config-logux/node4"
}
```
28 changes: 28 additions & 0 deletions base.js
@@ -0,0 +1,28 @@
module.exports = {
extends: 'standard',
rules: {
'computed-property-spacing': ['error', 'never'],
'array-bracket-spacing': ['error', 'never'],
'func-name-matching': 'error',
'no-useless-return': 'error',
'consistent-return': 'error',
'multiline-ternary': ['error', 'never'],
'no-nested-ternary': 'error',
'block-scoped-var': 'error',
'no-invalid-this': 'error',
'global-require': 'error',
'no-unused-vars': [2, { 'vars': 'all', 'args': 'after-used' }],
'no-lonely-if': 'error',
'valid-jsdoc': 'error',
'func-style': ['error', 'declaration'],
'no-shadow': 'error',
'max-len': [2, 80],
'strict': ['error', 'global'],
'no-new': 'off'
},
env: {
browser: true,
node: true,
jest: true
}
}
29 changes: 2 additions & 27 deletions index.js
@@ -1,32 +1,7 @@
module.exports = {
extends: [
'standard',
'./base.js',
'plugin:es5/no-es2015',
'plugin:es5/no-es2016'
],
rules: {
'computed-property-spacing': ['error', 'never'],
'array-bracket-spacing': ['error', 'never'],
'func-name-matching': 'error',
'no-useless-return': 'error',
'consistent-return': 'error',
'multiline-ternary': ['error', 'never'],
'no-nested-ternary': 'error',
'block-scoped-var': 'error',
'no-invalid-this': 'error',
'global-require': 'error',
'no-unused-vars': [2, { 'vars': 'all', 'args': 'after-used' }],
'no-lonely-if': 'error',
'valid-jsdoc': 'error',
'func-style': ['error', 'declaration'],
'no-shadow': 'error',
'max-len': [2, 80],
'strict': ['error', 'global'],
'no-new': 'off'
},
env: {
browser: true,
node: true,
jest: true
}
]
}
28 changes: 28 additions & 0 deletions node4.js
@@ -0,0 +1,28 @@
module.exports = {
extends: [
'./base.js'
],
plugins: [
'node'
],
rules: {
'plugin:es5/no-es2015': 'off',
'plugin:es5/no-es2016': 'off',
'node/no-unsupported-features': 'error',
'node/no-deprecated-api': 'error',
'no-const-assign': 'error',
'no-dupe-class-members': 'error',
'no-new-symbol': 'error',
'no-var': 'error',
'require-yield': 'error',
'constructor-super': 'error',
'no-this-before-super': 'error',
'generator-star-spacing': ['error', {'before': true}],
'prefer-arrow-callback': 'error',
'arrow-parens': ['error', 'as-needed'],
'arrow-body-style': ['error', 'always']
},
env: {
es6: true
}
}
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -14,13 +14,15 @@
"eslint": "^3.8.0",
"eslint-config-standard": "^6.2.0",
"eslint-plugin-es5": "^1.0.1",
"eslint-plugin-node": "^4.0.1",
"eslint-plugin-promise": "^3.0.0",
"eslint-plugin-standard": "^2.0.1"
},
"devDependencies": {
"eslint": "^3.9.0",
"eslint-config-standard": "^6.2.1",
"eslint-plugin-es5": "^1.0.1",
"eslint-plugin-node": "^4.0.1",
"eslint-plugin-promise": "^3.3.0",
"eslint-plugin-standard": "^2.0.1",
"lint-staged": "^3.2.0",
Expand Down

0 comments on commit ff1fc14

Please sign in to comment.