Skip to content

Commit

Permalink
Merge pull request #2 from NotNinja/develop
Browse files Browse the repository at this point in the history
Release 0.2.0
  • Loading branch information
neocotic authored Jul 3, 2017
2 parents 223b428 + ad1c4f2 commit fd6e4ff
Show file tree
Hide file tree
Showing 8 changed files with 166 additions and 22 deletions.
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## Version 0.2.0, 2017.07.03

* Add missing rules as of ESLint 4
* Remove deprecated/removed rules as of ESLint 4
* Add ES7/2016 & ES8/2017 configurations
* Update rules to align with common usage

## Version 0.1.1, 2017.05.01

* Fix bug with missing comma after `sort-keys` rule
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,15 @@ Create an ESLint configuration file within your package that extends this config
}
```

This will import the ECMAScript 5 configuration by default. This can also be done by extending `"notninja/es5"`. For
ECMAScript 6 packages, please extend `"notninja/es6"` instead.
This will extend the ECMAScript 5 configuration by default, but you can extend other ECMAScript versions by using the
following:

| ECMAScript Version | Value |
| ------------------ | -------------------------------- |
| 5 | `"notninja"` or `"notninja/es5"` |
| 6 (2015) | `"notninja/es6"` |
| 7 (2016) | `"notninja/es7"` |
| 8 (2017) | `"notninja/es8"` |

## Bugs

Expand Down
86 changes: 68 additions & 18 deletions es5.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ module.exports = {
ecmaVersion: 5
},
rules: {
'for-direction': 'error',
'no-compare-neg-zero': 'error',
'no-cond-assign': 'error',
'no-console': 'error',
'no-constant-condition': 'error',
Expand All @@ -35,8 +37,8 @@ module.exports = {
'no-dupe-args': 'error',
'no-dupe-keys': 'error',
'no-duplicate-case': 'error',
'no-empty-character-class': 'error',
'no-empty': 'error',
'no-empty-character-class': 'error',
'no-ex-assign': 'error',
'no-extra-boolean-cast': 'error',
'no-extra-parens': [
Expand Down Expand Up @@ -89,8 +91,7 @@ module.exports = {
'no-case-declarations': 'error',
'no-div-regex': 'error',
'no-else-return': 'warn',
'no-empty-function': 'warn',
'no-empty-pattern': 'error',
'no-empty-function': 'off',
'no-eq-null': 'off',
'no-eval': 'error',
'no-extend-native': 'error',
Expand All @@ -107,14 +108,14 @@ module.exports = {
'no-labels': 'error',
'no-lone-blocks': 'error',
'no-loop-func': 'error',
'no-magic-numbers': 'off',
'no-magic-numbers': 'warn',
'no-multi-spaces': 'error',
'no-multi-str': 'error',
'no-new': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-new': 'error',
'no-octal-escape': 'error',
'no-octal': 'error',
'no-octal-escape': 'error',
'no-param-reassign': 'off',
'no-proto': 'error',
'no-redeclare': 'error',
Expand All @@ -130,6 +131,7 @@ module.exports = {
'no-useless-call': 'error',
'no-useless-concat': 'error',
'no-useless-escape': 'error',
'no-useless-return': 'error',
'no-void': 'error',
'no-warning-comments': 'warn',
'no-with': 'error',
Expand All @@ -145,17 +147,28 @@ module.exports = {
'no-delete-var': 'error',
'no-label-var': 'error',
'no-restricted-globals': 'error',
'no-shadow-restricted-names': 'error',
'no-shadow': 'error',
'no-undef-init': 'error',
'no-shadow-restricted-names': 'error',
'no-undef': 'error',
'no-undef-init': 'error',
'no-undefined': 'error',
'no-unused-vars': 'warn',
'no-use-before-define': 'error',
'no-unused-vars': [
'warn',
{
'args': 'none'
}
],
'no-use-before-define': [
'error',
{
'functions': false
}
],

'callback-return': 'warn',
'global-require': 'error',
'handle-callback-err': 'warn',
'no-buffer-constructor': 'error',
'no-mixed-requires': 'warn',
'no-new-require': 'error',
'no-path-concat': 'error',
Expand All @@ -164,13 +177,26 @@ module.exports = {
'no-restricted-modules': 'off',
'no-sync': 'off',

'array-bracket-newline': [
'error',
{
'multiline': true
}
],
'array-bracket-spacing': [
'error',
'always'
],
'array-element-newline': [
'error',
{
'multiline': true
}
],
'block-spacing': 'error',
'brace-style': 'error',
'camelcase': 'error',
'capitalized-comments': 'error',
'comma-dangle': 'error',
'comma-spacing': 'error',
'comma-style': 'error',
Expand All @@ -197,6 +223,12 @@ module.exports = {
'jsx-quotes': 'error',
'key-spacing': 'error',
'keyword-spacing': 'error',
'line-comment-position': [
'error',
{
'position': 'above'
}
],
'linebreak-style': [
'error',
'unix'
Expand All @@ -209,23 +241,31 @@ module.exports = {
2
],
'max-lines': 'off',
'max-nested-callbacks': 'error',
'max-params': 'error',
'max-statements-per-line': 'error',
'max-nested-callbacks': [
'error',
10
],
'max-params': [
'error',
5
],
'max-statements': 'off',
'max-statements-per-line': [
'error',
1
],
'multiline-ternary': 'off',
'new-cap': 'error',
'new-parens': 'error',
'newline-after-var': 'off',
'newline-before-return': 'off',
'newline-per-chained-call': 'off',
'no-array-constructor': 'error',
'no-bitwise': 'error',
'no-bitwise': 'warn',
'no-continue': 'off',
'no-inline-comments': 'error',
'no-lonely-if': 'error',
'no-mixed-operators': 'warn',
'no-mixed-spaces-and-tabs': 'error',
'no-multi-assign': 'error',
'no-multiple-empty-lines': 'error',
'no-negated-condition': 'off',
'no-nested-ternary': 'warn',
Expand All @@ -238,6 +278,10 @@ module.exports = {
'no-underscore-dangle': 'off',
'no-unneeded-ternary': 'error',
'no-whitespace-before-property': 'error',
'nonblock-statement-body-position': [
'error',
'below'
],
'object-curly-newline': [
'error',
{
Expand All @@ -249,13 +293,13 @@ module.exports = {
'always'
],
'object-property-newline': 'off',
'one-var-declaration-per-line': 'error',
'one-var': [
'error',
{
'initialized': 'never'
}
],
'one-var-declaration-per-line': 'error',
'operator-assignment': 'warn',
'operator-linebreak': 'error',
'padded-blocks': [
Expand All @@ -266,6 +310,7 @@ module.exports = {
'switches': 'never'
}
],
'padding-line-between-statements': 'off',
'quote-props': [
'error',
'consistent-as-needed'
Expand All @@ -275,11 +320,15 @@ module.exports = {
'single'
],
'require-jsdoc': 'off',
'semi-spacing': 'error',
'semi': [
'error',
'always'
],
'semi-spacing': 'error',
'semi-style': [
'error',
'last'
],
'sort-keys': 'off',
'sort-vars': 'off',
'space-before-blocks': 'error',
Expand All @@ -291,6 +340,7 @@ module.exports = {
'space-infix-ops': 'error',
'space-unary-ops': 'error',
'spaced-comment': 'error',
'switch-colon-spacing': 'error',
'unicode-bom': 'error',
'wrap-regex': 'off'
}
Expand Down
11 changes: 10 additions & 1 deletion es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ module.exports = {
ecmaVersion: 6
},
rules: {
'class-methods-use-this': 'warn',
'no-empty-pattern': 'error',
'prefer-promise-reject-errors': 'error',
'template-tag-spacing': [
'error',
'never'
],

'arrow-body-style': 'off',
'arrow-parens': [
'error',
Expand All @@ -54,7 +62,8 @@ module.exports = {
'object-shorthand': 'warn',
'prefer-arrow-callback': 'warn',
'prefer-const': 'warn',
'prefer-reflect': 'off',
'prefer-destructuring': 'off',
'prefer-numeric-literals': 'warn',
'prefer-rest-params': 'warn',
'prefer-spread': 'warn',
'prefer-template': 'error',
Expand Down
30 changes: 30 additions & 0 deletions es7.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (C) 2017 Alasdair Mercer, !ninja
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

'use strict';

module.exports = {
extends: './es6.js',
parserOptions: {
ecmaVersion: 7
}
};
36 changes: 36 additions & 0 deletions es8.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (C) 2017 Alasdair Mercer, !ninja
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

'use strict';

module.exports = {
extends: './es7.js',
parserOptions: {
ecmaVersion: 8
},
rules: {
'no-await-in-loop': 'error',

'no-return-await': 'error',
'require-await': 'error'
}
};
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-notninja",
"version": "0.1.1",
"version": "0.2.0",
"description": "Standard ESLint configurations for !ninja packages",
"homepage": "https://github.com/NotNinja/eslint-config-notninja",
"bugs": {
Expand Down

0 comments on commit fd6e4ff

Please sign in to comment.