diff --git a/CHANGELOG.md b/CHANGELOG.md index 031c0df..1304ecd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,35 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Removed +## [2.2.0] - 2017-10-29 +### Added + +Added one new rule from ESLint v4.9.0. +* [lines-between-class-members](http://eslint.org/docs/rules/lines-between-class-members) + +Added one new rule from ESLint v4.6.0. +* [function-paren-newline](http://eslint.org/docs/rules/function-paren-newline) + +Added one new rule from ESLint v4.2.0. +* [getter-return](http://eslint.org/docs/rules/getter-return) + +Added four new rules from ESLint v4.0.0-beta.0 +* [semi-style](https://eslint.org/docs/4.0.0/rules/semi-style) +* [padding-line-between-statements](https://eslint.org/docs/4.0.0/rules/padding-line-between-statements) +* [for-direction](https://eslint.org/docs/4.0.0/rules/for-direction) +* [switch-colon-spacing](https://eslint.org/docs/4.0.0/rules/switch-colon-spacing) + +Added one new rule from ESLint v4.0.0-alpha.0 +* [no-buffer-constructor](https://eslint.org/docs/rules/no-buffer-constructor) + +Added one new rule from ESLint v3.17.0 +* [no-compare-neg-zero](https://eslint.org/docs/rules/no-compare-neg-zero) + +### Removed +* [lines-around-directive](https://eslint.org/docs/rules/lines-around-directive) +* [newline-after-var](https://eslint.org/docs/rules/newline-after-var) +* [newline-before-return](https://eslint.org/docs/rules/newline-before-return) + ## [2.1.0] - 2017-07-30 ### Added * `object-curly-newline` to test file override diff --git a/index.js b/index.js index 758d127..0fa282c 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,6 @@ 'use strict'; -/* eslint id-length: 'off', max-lines: 'off' */ +/* eslint id-length: 'off', max-lines: 'off', array-bracket-newline: 'off', array-element-newline: 'off' */ module.exports = { parserOptions: { @@ -142,8 +142,6 @@ module.exports = { 'max-statements-per-line': ['error', {max: 1}], 'new-cap': 'error', 'new-parens': 'error', - 'newline-after-var': 'error', - 'newline-before-return': 'error', 'newline-per-chained-call': ['error', {ignoreChainWithDepth: 4}], 'no-array-constructor': 'error', 'no-bitwise': 'error', @@ -252,10 +250,6 @@ module.exports = { 'no-template-curly-in-string': 'error', 'symbol-description': 'error', 'line-comment-position': ['error', {position: 'above'}], - 'lines-around-directive': ['error', { - before: 'never', - after: 'always' - }], 'no-useless-return': 'error', 'no-return-await': 'error', 'require-await': 'error', @@ -270,7 +264,35 @@ module.exports = { 'no-else-return': 'error', 'no-new': 'error', 'no-unsafe-finally': 'error', - 'no-unused-vars': ['error', {vars: 'local', args: 'after-used', ignoreRestSiblings: true}] + 'no-unused-vars': ['error', {vars: 'local', args: 'after-used', ignoreRestSiblings: true}], + 'no-buffer-constructor': 'error', + 'lines-between-class-members': ['error', 'always'], + 'no-compare-neg-zero': 'error', + 'semi-style': ['error', 'last'], + 'padding-line-between-statements': [ + 'error', + {blankLine: 'always', prev: '*', next: 'return'}, + {blankLine: 'always', prev: ['const', 'let', 'var'], next: '*'}, + {blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var']}, + {blankLine: 'always', prev: 'directive', next: '*'}, + {blankLine: 'always', prev: ['for', 'do', 'while'], next: '*'}, + {blankLine: 'always', prev: '*', next: 'for'}, + {blankLine: 'always', prev: 'import', next: '*'}, + {blankLine: 'any', prev: 'import', next: 'import'}, + {blankLine: 'always', prev: 'if', next: '*'}, + {blankLine: 'always', prev: 'function', next: '*'}, + {blankLine: 'always', prev: '*', next: 'function'}, + {blankLine: 'always', prev: '*', next: 'export'}, + {blankLine: 'always', prev: '*', next: 'cjs-export'}, + {blankLine: 'always', prev: 'cjs-import', next: '*'}, + {blankLine: 'any', prev: 'cjs-import', next: 'cjs-import'} + ], + 'for-direction': 'error', + 'switch-colon-spacing': 'error', + 'getter-return': 'error', + 'function-paren-newline': ['error', 'never'], + 'array-element-newline': ['error', {minItems: 3}], + 'array-bracket-newline': ['error', {multiline: true, minItems: 3}] }, overrides: [ { @@ -282,10 +304,27 @@ module.exports = { rules: { 'max-nested-callbacks': 'off', 'max-statements': 'off', - 'newline-after-var': 'off', 'no-unused-expressions': 'off', 'no-unused-vars': 'off', - 'object-curly-newline': 'off' + 'object-curly-newline': 'off', + 'padding-line-between-statements': [ + 'error', + {blankLine: 'always', prev: '*', next: 'return'}, + {blankLine: 'any', prev: ['const', 'let', 'var'], next: '*'}, + {blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var']}, + {blankLine: 'always', prev: 'directive', next: '*'}, + {blankLine: 'any', prev: ['for', 'do', 'while'], next: '*'}, + {blankLine: 'any', prev: '*', next: 'for'}, + {blankLine: 'always', prev: 'import', next: '*'}, + {blankLine: 'any', prev: 'import', next: 'import'}, + {blankLine: 'any', prev: 'if', next: '*'}, + {blankLine: 'any', prev: 'function', next: '*'}, + {blankLine: 'any', prev: '*', next: 'function'}, + {blankLine: 'always', prev: '*', next: 'export'}, + {blankLine: 'always', prev: '*', next: 'cjs-export'}, + {blankLine: 'always', prev: 'cjs-import', next: '*'}, + {blankLine: 'any', prev: 'cjs-import', next: 'cjs-import'} + ] } } ] diff --git a/package.json b/package.json index 93096f9..d4d3178 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-tc", - "version": "2.1.0", + "version": "2.2.0", "description": "ESLint shareable config for TC's projects", "keywords": [ "eslintconfig", @@ -29,17 +29,17 @@ "test": "mocha" }, "devDependencies": { - "chai": "^4.1.0", - "eslint": "^4.3.0", - "eslint-formatter-pretty": "^1.1.0", + "chai": "^4.1.2", + "eslint": "^4.10.0", + "eslint-formatter-pretty": "^1.3.0", "is-plain-obj": "^1.1.0", - "mocha": "^3.4.2", - "npm-package-json-lint": "^2.5.0", - "npm-package-json-lint-config-tc": "^1.0.0", - "temp-write": "^3.2.0" + "mocha": "^4.0.1", + "npm-package-json-lint": "^2.11.0", + "npm-package-json-lint-config-tc": "^1.1.0", + "temp-write": "^3.3.0" }, "peerDependencies": { - "eslint": "^4.3.0" + "eslint": "^4.10.0" }, "engines": { "node": ">=4.2.0",