Socket
Socket
Sign inDemoInstall

eslint-config-airbnb

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-airbnb - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

base/index.js

20

index.js

@@ -1,11 +0,13 @@

var path = require('path');
var stripComments = require('strip-json-comments');
var fs = require('fs');
const reactRules = require('./react');
const base = require('./base');
// you could do this all at once if you wanted to look cool
var filename = path.join(__dirname, '.eslintrc');
var data = fs.readFileSync(filename, {encoding: 'utf-8'});
var dataWithoutComments = stripComments(data);
var parsed = JSON.parse(dataWithoutComments);
// clone this so we aren't mutating a module
const eslintrc = JSON.parse(JSON.stringify(base));
module.exports = parsed;
// 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;
{
"name": "eslint-config-airbnb",
"version": "0.0.7",
"version": "0.0.8",
"description": "Airbnb's ESLint config, following our styleguide",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"lint": "./node_modules/.bin/eslint .",
"test": "./node_modules/.bin/babel-tape-runner ./test/test-*.js"
},

@@ -27,5 +28,10 @@ "repository": {

"homepage": "https://github.com/airbnb/javascript",
"dependencies": {
"strip-json-comments": "1.0.2"
"devDependencies": {
"babel-eslint": "4.0.10",
"babel-tape-runner": "1.2.0",
"eslint": "1.1.0",
"eslint-plugin-react": "3.2.3",
"react": "0.13.3",
"tape": "4.2.0"
}
}

@@ -7,7 +7,30 @@ # eslint-config-airbnb

### With React Style
1. `npm install --save-dev eslint-config-airbnb babel-eslint eslint-plugin-react`
2. add `"extends": "eslint-config-airbnb"` to your .eslintrc
2. add `"extends": "airbnb"` to your .eslintrc
### Without React Style
1. `npm install --save-dev eslint-config-airbnb babel-eslint `
2. add `"extends": "airbnb/base"` to your .eslintrc
See [Airbnb's Javascript styleguide](https://github.com/airbnb/javascript) and
the [ESlint config docs](http://eslint.org/docs/user-guide/configuring#extending-configuration-files)
for more information.
## Improving this config
Consider adding test cases if you're making complicated rules changes, like
anything involving regexes. Perhaps in a distant future, we could use literate
programming to structure our README as test cases for our .eslintrc?
You can run tests with `npm test`.
You can make sure this module lints with itself using `npm run lint`.
## Changelog
### 0.0.8
- now has a changelog
- now is modular (see instructions above for with react and without react versions)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc