Skip to content

Commit 7055b70

Browse files
author
Kent C. Dodds
committed
fix(compat): Fix issues with node@^0.10
1 parent f99a04c commit 7055b70

File tree

6 files changed

+13
-9
lines changed

6 files changed

+13
-9
lines changed

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/
2+
coverage/
3+
.nyc_output/
4+

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ notifications:
77
email: false
88
node_js:
99
- '4'
10-
- iojs-v3
11-
- iojs-v2
12-
- iojs-v1
13-
- '0.12'
1410
- '0.10'
1511
before_install:
1612
- npm i -g npm@^3.0.0

bin.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
// Prints rules recognized by ESLint that don't appear in the given config
66
// preset. It helps with upgrading the preset when new ESLint gets released.
77
var path = require('path')
8-
var findNewRules = require('.')
8+
var isAbsolute = require('path-is-absolute')
9+
var findNewRules = require('./index')
910

1011
var currentRules = Object.keys(getConfig().rules)
1112
var newRules = findNewRules(currentRules)
@@ -19,7 +20,7 @@ function getConfig() {
1920
var specifiedFile = process.argv[2]
2021
if (specifiedFile) {
2122
// this is being called like: eslint-find-new-rules eslint-config-mgol
22-
if (path.isAbsolute(specifiedFile)) {
23+
if (isAbsolute(specifiedFile)) {
2324
return require(specifiedFile)
2425
} else {
2526
return require(path.join(process.cwd(), specifiedFile))

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ module.exports = findNewRules
66
function findNewRules(currentRules) {
77
var allRules = fs
88
.readdirSync('./node_modules/eslint/lib/rules')
9-
.map(filename => filename.replace(/\.js$/, ''))
9+
.map(function removeJsFromFilename(filename) {
10+
return filename.replace(/\.js$/, '')
11+
})
1012

1113
return difference(allRules, currentRules)
1214
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
],
2525
"license": "MIT",
2626
"dependencies": {
27-
"lodash.difference": "4.1.1"
27+
"lodash.difference": "4.1.1",
28+
"path-is-absolute": "1.0.0"
2829
},
2930
"devDependencies": {
3031
"ava": "0.13.0",

test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import mock from 'mock-fs'
22
import test from 'ava'
3-
import findNewRules from '.'
3+
import findNewRules from './index'
44

55
try {
66
require('./bin') // requiring now for coverage until this is tested

0 commit comments

Comments
 (0)