eslint-config-airbnb
Advanced tools
Comparing version 0.0.7 to 0.0.8
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
17937
0
9
319
1
36
0
6
- Removedstrip-json-comments@1.0.2
- Removedstrip-json-comments@1.0.2(transitive)