diff --git a/.babelrc b/.babelrc deleted file mode 100644 index c13c5f6..0000000 --- a/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["es2015"] -} diff --git a/.travis.yml b/.travis.yml index f816090..1f1ebd1 100755 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: node_js node_js: - - 5 - 6 + - 8 script: npm run lint && npm run validate && npm test diff --git a/base.js b/base.js index 9e40644..3fb58be 100644 --- a/base.js +++ b/base.js @@ -136,7 +136,6 @@ module.exports = { 'no-useless-computed-key': 2, 'no-mixed-operators': 2, 'rest-spread-spacing': [2, 'never'], - 'lines-around-directive': [2, 'always'], 'no-useless-return': 2, 'no-return-await': 2, 'require-await': 2, @@ -148,6 +147,22 @@ module.exports = { 'no-compare-neg-zero': 2, 'nonblock-statement-body-position': 2, + // eslint v4 rules + // TODO: this might be worth looking at again if there's an option so that + // if theres any newline, require all newlines. Currently the newline option + // applies to an element in the array containing newlines. + // 'array-element-newline': [2, {multiline: true}], + 'semi-style': [2, 'last'], + 'switch-colon-spacing': 2, + 'array-bracket-newline': ['error', {multiline: true}], + 'no-buffer-constructor': 2, + 'padding-line-between-statements': [ + 2, + // These take the place of the deprected lines-around-directive + {blankLine: 'always', prev: 'directive', next: '*'}, + {blankLine: 'any', prev: 'directive', next: 'directive'} + ], + // Promise 'promise/catch-or-return': 2, 'promise/no-return-wrap': 2, diff --git a/package.json b/package.json index 752de46..1617fee 100644 --- a/package.json +++ b/package.json @@ -9,15 +9,13 @@ "dependencies": {}, "devDependencies": { "babel-eslint": "^7.2.3", - "babel-preset-es2015": "^6.24.1", - "babel-tape-runner": "^2.0.1", - "eslint": "^3.19.0", - "eslint-import-resolver-webpack": "^0.8.1", + "eslint": "^4.0.0", + "eslint-import-resolver-webpack": "^0.8.3", "eslint-plugin-babel": "^4.1.1", "eslint-plugin-classes": "^0.1.1", - "eslint-plugin-import": "^2.2.0", + "eslint-plugin-import": "^2.6.0", "eslint-plugin-promise": "^3.5.0", - "eslint-plugin-react": "^7.0.0", + "eslint-plugin-react": "^7.1.0", "espree": "^3.4.3", "git-validate": "^2.2.2", "greenkeeper-postpublish": "^1.0.1", @@ -33,7 +31,7 @@ "license": "MIT", "main": "index.js", "peerDependencies": { - "eslint": "^3.5.0" + "eslint": "^4.0.0" }, "pre-commit": [ "validate", @@ -47,7 +45,7 @@ "scripts": { "lint": "eslint -c index.js .", "postpublish": "greenkeeper-postpublish", - "test": "babel-tape-runner test/*.js", + "test": "tape test/*.js", "validate": "npm ls >/dev/null" } } diff --git a/test/basic.js b/test/basic.js index 3e5ef8f..5016cfc 100755 --- a/test/basic.js +++ b/test/basic.js @@ -1,9 +1,9 @@ 'use strict'; -import test from 'tape'; -import config from '../index.js'; // eslint-disable-line import/default -import configNoBabel from '../no-babel.js'; // eslint-disable-line import/default -import configBase from '../base.js'; // eslint-disable-line import/default +const test = require('tape'); +const config = require('../index.js'); +const configNoBabel = require('../no-babel.js'); +const configBase = require('../base.js'); const isObject = (obj) => typeof obj === 'object' && obj !== null; const isString = (obj) => typeof obj === 'string'; diff --git a/test/validate-config.js b/test/validate-config.js index 11a5aa2..efd843e 100755 --- a/test/validate-config.js +++ b/test/validate-config.js @@ -1,7 +1,7 @@ 'use strict'; -import test from 'tape'; -import {CLIEngine} from 'eslint'; +const test = require('tape'); +const {CLIEngine} = require('eslint'); const code = ` 'use strict'; @@ -28,7 +28,10 @@ t(bar); test('load config in eslint to validate all rule syntax is correct', (t) => { const {results, errorCount, warningCount} = new CLIEngine({ useEslintrc: false, - configFile: 'index.js' + configFile: 'index.js', + parserOptions: { + sourceType: 'module' + } }).executeOnText(code); t.equal(results.length, 1, 'One result (empty)');