Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Commit

Permalink
Merge pull request #45 from lukekarrys/greenkeeper/eslint-4.0.0
Browse files Browse the repository at this point in the history
Update eslint to the latest version 🚀
  • Loading branch information
lukekarrys committed Jun 23, 2017
2 parents f8238a5 + 4682979 commit 30c7517
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 20 deletions.
3 changes: 0 additions & 3 deletions .babelrc

This file was deleted.

2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: node_js
node_js:
- 5
- 6
- 8
script: npm run lint && npm run validate && npm test
17 changes: 16 additions & 1 deletion base.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
14 changes: 6 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -33,7 +31,7 @@
"license": "MIT",
"main": "index.js",
"peerDependencies": {
"eslint": "^3.5.0"
"eslint": "^4.0.0"
},
"pre-commit": [
"validate",
Expand All @@ -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"
}
}
8 changes: 4 additions & 4 deletions test/basic.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
9 changes: 6 additions & 3 deletions test/validate-config.js
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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)');
Expand Down

0 comments on commit 30c7517

Please sign in to comment.