diff --git a/CHANGELOG.md b/CHANGELOG.md index e081b05..8815d90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,15 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Removed +## [4.0.0] - 2018-06-23 +### Added +Added two new rules from ESLint v5.0.0. +* [max-classes-per-file](https://eslint.org/docs/rules/max-classes-per-file) - Using default of one class per file. +* [max-lines-per-function](https://eslint.org/docs/rules/max-lines-per-function) - Using defaults. (Ignored for test files.) + +Added older rule based on new options in ESLint v5.0.0 +* [array-element-newline](https://eslint.org/docs/rules/array-element-newline) - Set to `consistent`, which requires consistent usage of linebreaks between array elements. (Ignored for test files.) + ## [3.2.0] - 2018-06-16 ### Removed * `array-element-newline` diff --git a/index.js b/index.js index 5c888ef..aadadb4 100644 --- a/index.js +++ b/index.js @@ -17,6 +17,7 @@ module.exports = { 'array-bracket-spacing': ['error', 'never'], 'array-callback-return': 'error', 'arrow-body-style': ['error', 'as-needed'], + 'array-element-newline': ['error', 'consistent'], 'arrow-parens': ['error', 'always'], 'arrow-spacing': ['error', { before: true, @@ -76,12 +77,14 @@ module.exports = { beforeBlockComment: true, beforeLineComment: true }], + 'max-classes-per-file': 'error', 'max-depth': ['error', 4], 'max-lines': ['error', { max: 300, skipComments: true, skipBlankLines: true }], + 'max-lines-per-function': 'error', 'max-nested-callbacks': ['error', 4], 'max-params': ['error', 4], 'max-statements': ['error', 12], @@ -304,8 +307,10 @@ module.exports = { env: {mocha: true}, rules: { 'array-bracket-newline': 'off', + 'array-element-newline': 'off', 'id-length': 'off', 'max-lines': 'off', + 'max-lines-per-function': 'off', 'max-nested-callbacks': 'off', 'max-statements': 'off', 'newline-after-var': 'off', diff --git a/package.json b/package.json index bc8db17..6cc3b29 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-config-tc", - "version": "3.2.0", + "version": "4.0.0", "description": "ESLint shareable config for JavaScript projects", "keywords": [ "eslintconfig", @@ -30,7 +30,7 @@ }, "devDependencies": { "chai": "^4.1.2", - "eslint": "^4.19.1", + "eslint": "^5.0.0", "eslint-formatter-pretty": "^1.3.0", "is-plain-obj": "^1.1.0", "mocha": "^5.2.0", @@ -39,7 +39,7 @@ "temp-write": "^3.4.0" }, "peerDependencies": { - "eslint": "^4.19.1" + "eslint": "^5.0.0" }, "engines": { "node": ">=6.0.0", diff --git a/test/tests.test.js b/test/tests.test.js index 5ff0898..43163c0 100644 --- a/test/tests.test.js +++ b/test/tests.test.js @@ -43,7 +43,7 @@ describe('eslint config tests', () => { error.ruleId.should.equal('no-console'); error.line.should.equal(expectedErrorLineNum); error.column.should.equal(expectedErrorColumnNum); - error.source.should.equal('console.log("doh, I used the wrong quotes");'); + error.message.should.equal('Unexpected console statement.'); }); }); });