Skip to content

Commit

Permalink
Feature/new eslint rules (#2)
Browse files Browse the repository at this point in the history
* Add four new rules from 2.12.0

* Update node version to cover v4 vs v4.2

* Add new eslint rules

- Bump dependencies including moving to ESLint 3.6.0
- Add line-comment-position, lines-around-directive,
symbol-description, no-template-curly-in-string, no-tabs
- Updated `no-native-reassign` => `no-global-assign` and
`no-negated-in-lhs` => `no-unsafe-negation` because of
http://eslint.org/blog/2016/08/eslint-v3.3.0-released
  • Loading branch information
tclindner authored Sep 26, 2016
1 parent a47043f commit 6e31d60
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ sudo: false
language: node_js

node_js:
- "4.2"
- "4"
- "5"
- "6"

Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,28 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Removed

## [1.2.0] - 2016-09-25
### Added
Added two new rules from ESLint v3.5.0.

* [line-comment-position](http://eslint.org/docs/rules/line-comment-position)
* [lines-around-directive](http://eslint.org/docs/rules/lines-around-directive)

Added one new rule from ESLint v3.4.0.

* [symbol-description](http://eslint.org/docs/rules/symbol-description)

Added one new rule from ESLint v3.3.0.

* [no-template-curly-in-string](http://eslint.org/docs/rules/no-template-curly-in-string)

Added one new rule from ESLint v3.2.0.

* [no-tabs](http://eslint.org/docs/rules/no-tabs) - Adds `disallowTabs` compatibility from JSCS.

### Changed
* Updated `no-native-reassign` => `no-global-assign` and `no-negated-in-lhs` => `no-unsafe-negation` because of [deprecation notice](http://eslint.org/blog/2016/08/eslint-v3.3.0-released)

## [1.1.0] - 2016-07-25
### Added
Added four new rules from ESLint v2.12.0.
Expand Down
14 changes: 12 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module.exports = {
'allowConstructorFlags': ['u', 'y']
}],
'no-irregular-whitespace': 'error',
'no-negated-in-lhs': 'error',
'no-unsafe-negation': 'error',
'no-obj-calls': 'error',
'no-regex-spaces': 'error',
'no-sparse-arrays': 'error',
Expand Down Expand Up @@ -74,7 +74,7 @@ module.exports = {
}],
'no-multi-spaces': 'error',
'no-multi-str': 'error',
'no-native-reassign': 'error',
'no-global-assign': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-octal': 'error',
Expand Down Expand Up @@ -257,6 +257,16 @@ module.exports = {
['in', 'instanceof']
],
'allowSamePrecedence': true
}],
'no-tabs': 'error',
'no-template-curly-in-string': 'error',
'symbol-description': 'error',
'line-comment-position': ['error', {
'position': 'above'
}],
'lines-around-directive': ['error', {
'before': 'never',
'after': 'always'
}]
}
};
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-config-tc",
"version": "1.1.0",
"version": "1.2.0",
"description": "ESLint shareable config for TC's projects",
"keywords": [
"eslintconfig",
Expand Down Expand Up @@ -31,18 +31,18 @@
"test": "mocha test"
},
"devDependencies": {
"eslint": "^3.1.0",
"eslint-formatter-pretty": "^0.2.2",
"eslint": "^3.6.0",
"eslint-formatter-pretty": "^1.0.0",
"is-plain-obj": "^1.1.0",
"jscs": "^3.0.7",
"jsonlint": "^1.6.2",
"mocha": "^2.5.3",
"npm-package-json-lint": "^1.1.0",
"should": "^9.0.2",
"mocha": "^3.0.2",
"npm-package-json-lint": "^1.3.0",
"should": "^11.1.0",
"temp-write": "^2.1.0"
},
"peerDependencies": {
"eslint": "^3.0.0"
"eslint": "^3.6.0"
},
"engines": {
"node": ">=4.2.0",
Expand Down
4 changes: 2 additions & 2 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ describe('eslint config tests', () => {

context('run eslint and make sure it runs', () => {
it('eslint should run without failing', () => {
const code = '\'use strict\';\nconsole.log("doh, I used the wrong quotes");\n';
const expectedErrorLineNum = 2;
const code = '\'use strict\';\n\nconsole.log("doh, I used the wrong quotes");\n';
const expectedErrorLineNum = 3;
const expectedErrorColumnNum = 13;
const errors = lint(code, eslintConfig);
const error = errors[0];
Expand Down

0 comments on commit 6e31d60

Please sign in to comment.