Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions packages/eslint-config-airbnb/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"rules": {
// disable requiring trailing commas because it might be nice to revert to
// being JSON at some point, and I don't want to make big changes now.
"comma-dangle": 0,
// disabled because I find it tedious to write tests while following this
// rule
"no-shadow": 0
"comma-dangle": 0
}
}
23 changes: 23 additions & 0 deletions packages/eslint-config-airbnb/base.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
'extends': [
'./rules/best-practices.js',
'./rules/errors.js',
'./rules/es6.js',
'./rules/legacy.js',
'./rules/node.js',
'./rules/strict.js',
'./rules/style.js',
'./rules/variables.js'
],
'parser': 'babel-eslint',
'env': {
'browser': true,
'node': true,
'amd': false,
'mocha': false,
'jasmine': false
},
'ecmaFeatures': {},
'globals': {},
'rules': {}
};
178 changes: 0 additions & 178 deletions packages/eslint-config-airbnb/base/index.js

This file was deleted.

20 changes: 7 additions & 13 deletions packages/eslint-config-airbnb/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
const reactRules = require('./react');
const base = require('./base');

// clone this so we aren't mutating a module
const eslintrc = JSON.parse(JSON.stringify(base));

// manually merge in React rules
eslintrc.plugins = reactRules.plugins;
Object.keys(reactRules.rules).forEach(function assignRule(ruleId) {
eslintrc.rules[ruleId] = reactRules.rules[ruleId];
});

module.exports = eslintrc;
module.exports = {
'extends': [
// Need to qualify these here for ESLint to resolve them properly.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you not just reference them relatively? I think that issue was why I was constructing a rules object instead of just extending 'base' previously. Can eslint resolve these when running npm run lint without special linking magicks?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm run lint didn't work when referencing them relatively. It interpreted them as the names of eslint-config-* packages for some reason.

It's possible that doing something like https://github.com/walmartlabs/eslint-config-defaults/blob/master/package.json#L34 involving making main not be index.js could work, but I didn't try it, because this approach seemed tolerable.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe all extends in eslint have to be named starting with "eslint-config", or a scoped package with the name ending in "/eslint-config".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ljharb I have no clue - the relative imports work here: https://github.com/airbnb/javascript/pull/526/files#diff-ca246d3b4ba146243647f872c0e7e8d1R3, but they didn't work on index.js. ¯_(ツ)_/¯

'airbnb/base',
'airbnb/rules/react.js'
]
};
10 changes: 5 additions & 5 deletions packages/eslint-config-airbnb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "Airbnb's ESLint config, following our styleguide",
"main": "index.js",
"scripts": {
"lint": "./node_modules/.bin/eslint .",
"test": "./node_modules/.bin/babel-tape-runner ./test/test-*.js"
"lint": "eslint .",
"test": "babel-tape-runner ./test/test-*.js"
},
"repository": {
"type": "git",
Expand All @@ -26,10 +26,10 @@
},
"homepage": "https://github.com/airbnb/javascript",
"devDependencies": {
"babel-eslint": "4.0.10",
"babel-eslint": "4.1.3",
"babel-tape-runner": "1.2.0",
"eslint": "1.3.0",
"eslint-plugin-react": "3.2.3",
"eslint": "1.5.1",
"eslint-plugin-react": "3.4.2",
"react": "0.13.3",
"tape": "4.2.0"
}
Expand Down
36 changes: 0 additions & 36 deletions packages/eslint-config-airbnb/react.js

This file was deleted.

Loading