Skip to content

Commit

Permalink
add eslint-plugin-import
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Jun 15, 2016
1 parent 4ae7f09 commit 7938f76
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 10 deletions.
7 changes: 3 additions & 4 deletions cli.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env node
/* eslint-disable import-order/import-order */
/* eslint-disable import/order */
'use strict';

var debug = require('debug')('xo');

// Prefer the local installation of XO.
Expand All @@ -15,11 +14,11 @@ if (!hasFlag('no-local') && localCLI && localCLI !== __filename) {
return;
}

var path = require('path');
var spawn = require('child_process').spawn;
var updateNotifier = require('update-notifier');
var getStdin = require('get-stdin');
var spawn = require('child_process').spawn;
var meow = require('meow');
var path = require('path');
var formatterPretty = require('eslint-formatter-pretty');
var xo = require('./');

Expand Down
32 changes: 28 additions & 4 deletions config/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,42 @@
module.exports = {
plugins: [
'no-use-extend-native',
'import-order',
'ava',
'xo',
'promise'
'promise',
'import'
],
extends: [
'plugin:ava/recommended',
'plugin:xo/recommended'
],
settings: {
'import/extensions': ['.js'] // TODO: remove this when eslint-plugin-import@2 is out
},
rules: {
'no-use-extend-native/no-use-extend-native': 2,
'import-order/import-order': 2,
'promise/param-names': 2
'promise/param-names': 2,
// disabled because of https://github.com/benmosher/eslint-plugin-import/issues/268
// 'import/default': 2,
'import/export': 2,
// disabled because of https://github.com/benmosher/eslint-plugin-import/issues/378
// 'import/extensions': [2, 'never'],
'import/imports-first': 2,
// disabled because of https://github.com/benmosher/eslint-plugin-import/issues/268
// 'import/named': 2,
'import/namespace': 2,
'import/newline-after-import': 2,
'import/no-amd': 2,
// enable this sometime in the future when Node.js has ES2015 module support
// 'import/no-commonjs': 2,
// looks useful, but too unstable at the moment
// 'import/no-deprecated': 2,
'import/no-extraneous-dependencies': 2,
'import/no-mutable-exports': 2,
'import/no-named-as-default-member': 2,
'import/no-named-as-default': 2,
// disabled because of https://github.com/benmosher/eslint-plugin-import/issues/275
// 'import/no-unresolved': [2, {commonjs: true}],
'import/order': 2
}
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"eslint-formatter-pretty": "^0.2.1",
"eslint-plugin-ava": "^2.0.0",
"eslint-plugin-babel": "^3.1.0",
"eslint-plugin-import-order": "^2.0.0",
"eslint-plugin-import": "^1.7.0",
"eslint-plugin-no-use-extend-native": "^0.3.2",
"eslint-plugin-promise": "^1.1.0",
"eslint-plugin-xo": "^0.5.0",
Expand Down
5 changes: 4 additions & 1 deletion test/fixtures/overrides/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"files": "test/foo.js",
"space": 4
}
]
],
"rules": {
"import/no-extraneous-dependencies": 0
}
}
}

0 comments on commit 7938f76

Please sign in to comment.