Skip to content

Commit

Permalink
Eslint5 support (#24)
Browse files Browse the repository at this point in the history
* Add support for ESLint 5

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.)

* Update test for new format
  • Loading branch information
tclindner authored Jun 23, 2018
1 parent 57873a1 commit 82ac7d6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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',
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -39,7 +39,7 @@
"temp-write": "^3.4.0"
},
"peerDependencies": {
"eslint": "^4.19.1"
"eslint": "^5.0.0"
},
"engines": {
"node": ">=6.0.0",
Expand Down
2 changes: 1 addition & 1 deletion test/tests.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.');
});
});
});

0 comments on commit 82ac7d6

Please sign in to comment.