Skip to content
Permalink
Browse files

initial commit

  • Loading branch information...
feross committed Feb 6, 2016
0 parents commit 47d5e248e2e078eb87619493999e3e74d4b7e70e
Showing with 216 additions and 0 deletions.
  1. +4 −0 .travis.yml
  2. +20 −0 LICENSE
  3. +96 −0 README.md
  4. +26 −0 eslintrc.json
  5. +1 −0 index.js
  6. +56 −0 package.json
  7. +13 −0 test/basic.js
@@ -0,0 +1,4 @@
language: node_js
node_js:
- '4'
- 'node'
20 LICENSE
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) Feross Aboukhadijeh

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,96 @@
# Standard React - ESLint Shareable Config
[![travis][travis-image]][travis-url]
[![npm][npm-image]][npm-url]
[![downloads][downloads-image]][downloads-url]

[travis-image]: https://img.shields.io/travis/feross/eslint-config-standard-jsx/master.svg
[travis-url]: https://travis-ci.org/feross/eslint-config-standard-jsx
[npm-image]: https://img.shields.io/npm/v/eslint-config-standard-jsx.svg
[npm-url]: https://npmjs.org/package/eslint-config-standard-jsx
[downloads-image]: https://img.shields.io/npm/dm/eslint-config-standard-jsx.svg
[downloads-url]: https://npmjs.org/package/eslint-config-standard-jsx

#### An ESLint [Shareable Config](http://eslint.org/docs/developer-guide/shareable-configs) for JSX support in [JavaScript Standard Style](http://standardjs.com)

This module is for advanced users. You probably want to use [`standard`](http://standardjs.com) instead :)

[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](http://standardjs.com)

## Install

```bash
npm install eslint-config-standard-jsx
```

## Usage

Shareable configs are designed to work with the `extends` feature of `.eslintrc` files.
You can learn more about
[Shareable Configs](http://eslint.org/docs/developer-guide/shareable-configs) on the
official ESLint website.

This Shareable Config adds extra JSX style rules to the baseline JavaScript Standard Style
rules provided in
[`eslint-config-standard`](https://www.npmjs.com/package/eslint-config-standard).
It doesn't assume that you're using React, so other virtual DOM libraries like
`virtual-dom` and `deku` are supported.

Even thought this config is JSX only (no React), it makes use of
[`eslint-plugin-react`](https://npmjs.com/package/eslint-plugin-react) for its generic
JSX rules.

(If you want React-specific rules too, consider using
[`eslint-config-standard-react`](https://www.npmjs.com/package/eslint-config-standard-react)
instead.)

Here's how to install everything you need:

```bash
npm install eslint-config-standard eslint-config-standard-jsx eslint-plugin-react
```

Then, add this to your .eslintrc file:

```
{
"extends": ["standard", "standard-jsx"]
}
```

*Note: We omitted the `eslint-config-` prefix since it is automatically assumed by ESLint.*

You can override settings from the shareable config by adding them directly into your
`.eslintrc` file.

### Looking for something easier than this?

The easiest way to use JavaScript Standard Style to check your code is to use the
[`standard`](http://standardjs.com) package. This comes with a global
Node command line program (`standard`) that you can run or add to your `npm test` script
to quickly check your style.

## Badge

Use this in one of your projects? Include one of these badges in your readme to
let people know that your code is using the standard style.

[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](http://standardjs.com)

```markdown
[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](http://standardjs.com)
```

[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com)

```markdown
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com)
```

## Learn more

For the full listing of rules, editor plugins, FAQs, and more, visit the main
[JavaScript Standard Style repo](http://standardjs.com).

## License

MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org).
@@ -0,0 +1,26 @@
{
"parserOptions": {
"ecmaVersion": 6,
"ecmaFeatures": {
"jsx": true
}
},

"plugins": [
"react"
],

"rules": {
"react/jsx-boolean-value": 2,
"react/jsx-closing-bracket-location": 2,
"react/jsx-curly-spacing": [2, "never"],
"react/jsx-equals-spacing": [2, "never"],
"react/jsx-indent": [2, 2],
"react/jsx-indent-props": [2, 2],
"react/jsx-no-duplicate-props": 2,
"react/jsx-no-undef": 2,
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2,
"react/self-closing-comp": 2
}
}
@@ -0,0 +1 @@
module.exports = require('./eslintrc.json')
@@ -0,0 +1,56 @@
{
"name": "eslint-config-standard-jsx",
"description": "JavaScript Standard Style JSX support - ESLint Shareable Config",
"version": "0.0.0",
"author": {
"name": "Feross Aboukhadijeh",
"email": "feross@feross.org",
"url": "http://feross.org/"
},
"bugs": {
"url": "https://github.com/feross/eslint-config-standard-jsx/issues"
},
"peerDependencies": {
"eslint-plugin-react": ">=2.7.1"
},
"devDependencies": {
"tape": "^4.0.0"
},
"homepage": "https://github.com/feross/eslint-config-standard-jsx",
"keywords": [
"standard",
"style checker",
"code style",
"code checker",
"code linter",
"style linter",
"simple",
"policy",
"style",
"code",
"lint",
"eslint",
"eslintconfig",
"jshint",
"jscs",
"hint",
"enforce",
"check",
"verify",
"quality",
"checker",
"code standards",
"JavaScript Standard Style",
"standard style",
"jsx"
],
"license": "MIT",
"main": "index.js",
"repository": {
"type": "git",
"url": "git://github.com/feross/eslint-config-standard-jsx.git"
},
"scripts": {
"test": "tape test/*.js"
}
}
@@ -0,0 +1,13 @@
var config = require('../')
var test = require('tape')

test('test basic properties of config', function (t) {
t.ok(isObject(config.parserOptions))
t.ok(isObject(config.rules))
t.ok(Array.isArray(config.plugins))
t.end()
})

function isObject (obj) {
return typeof obj === 'object' && obj !== null
}

0 comments on commit 47d5e24

Please sign in to comment.
You can’t perform that action at this time.