Skip to content

Commit

Permalink
add missing prefix on option examples
Browse files Browse the repository at this point in the history
  • Loading branch information
adnasa committed May 16, 2017
1 parent 647bcd4 commit 5a02508
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 12 deletions.
10 changes: 5 additions & 5 deletions docs/rules/jsx-closing-bracket-location.md
Expand Up @@ -71,7 +71,7 @@ The following patterns are considered warnings:
// 'jsx-closing-bracket-location': 1
// 'jsx-closing-bracket-location': [1, 'tag-aligned']
// 'jsx-closing-bracket-location': [1, 'line-aligned']
<Hello
<Hello
firstName="John"
lastName="Smith"
/>;
Expand Down Expand Up @@ -114,7 +114,7 @@ var x = function() {
};

// 'jsx-closing-bracket-location': [1, 'after-props']
<Hello
<Hello
firstName="John"
lastName="Smith"
/>;
Expand All @@ -127,7 +127,7 @@ var x = function() {
</Say>;

// 'jsx-closing-bracket-location': [1, 'props-aligned']
<Hello
<Hello
firstName="John"
lastName="Smith" />;

Expand Down Expand Up @@ -188,7 +188,7 @@ var x = function() {
};

// 'jsx-closing-bracket-location': [1, {selfClosing: 'after-props'}]
<Hello
<Hello
firstName="John"
lastName="Smith" />;

Expand All @@ -200,7 +200,7 @@ var x = function() {
</Say>;

// 'jsx-closing-bracket-location': [1, {selfClosing: 'props-aligned', nonEmpty: 'after-props'}]
<Hello
<Hello
firstName="John"
lastName="Smith"
/>;
Expand Down
6 changes: 3 additions & 3 deletions docs/rules/jsx-max-props-per-line.md
Expand Up @@ -76,9 +76,9 @@ The following patterns are not considered warnings:
```jsx
// [1, { "when": "multiline" }]
<Hello firstName="John" lastName="Smith" />
<Hello
firstName="John"
lastName="Smith"
<Hello
firstName="John"
lastName="Smith"
/>
```

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-unused-prop-types.md
Expand Up @@ -45,7 +45,7 @@ var Hello = createReactClass({

This rule can take one argument to ignore some specific props during validation.

```
```js
...
"react/no-unused-prop-types": [<enabled>, { customValidators: <customValidator>, skipShapeProps: <skipShapeProps> }]
...
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/prop-types.md
Expand Up @@ -100,7 +100,7 @@ Hello.propTypes = {

This rule can take one argument to ignore some specific props during validation.

```
```js
...
"react/prop-types": [<enabled>, { ignore: <ignore>, customValidators: <customValidator> }]
...
Expand Down
48 changes: 48 additions & 0 deletions docs/rules/require-extension.md
@@ -0,0 +1,48 @@
# Restrict file extensions that may be required (require-extension)

**Deprecation notice**: This rule is deprecated. Please use the eslint-plugin-import [extensions](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md) rule instead.

`require()` statements should generally not include a file extension as there is a well defined mechanism for resolving a module ID to a specific file. This rule inspects the module ID being required and creates a warning if the ID contains a '.jsx' file extension.

Note: this rule does not prevent required files from containing these extensions, it merely prevents the extension from being included in the `require()` statement.

## Rule Details

The following patterns are considered warnings:

```js
var index = require('./index.jsx');

// When [1, {extensions: ['.js']}]
var index = require('./index.js');
```

The following patterns are not considered warnings:

```js
var index = require('./index');

var eslint = require('eslint');
```

## Rule Options

The set of forbidden extensions is configurable. By default '.jsx' is blocked. If you wanted to forbid both '.jsx' and '.js', the configuration would be:

```js
...
"react/require-extension": [1, { "extensions": [".js", ".jsx"] }],
...
```

To configure WebPack to resolve '.jsx' add the following to `webpack.config.js`:

```js
resolve: {
extensions: ["", ".js", ".jsx"]
},
```

## When Not To Use It

If you have file in your project with a '.jsx' file extension and do not have `require()` configured to automatically resolve '.jsx' files.
2 changes: 1 addition & 1 deletion docs/rules/self-closing-comp.md
@@ -1,4 +1,4 @@
# Prevent extra closing tags for components without children (self-closing-comp)
# Prevent extra closing tags for components without children (react/self-closing-comp)

Components without children can be self-closed to avoid unnecessary extra closing tag.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/sort-comp.md
Expand Up @@ -39,7 +39,7 @@ var Hello = createReactClass({

This rule can take one argument to customize the components organisation.

```
```js
...
"react/sort-comp": [<enabled>, { order: <order>, groups: <groups> }]
...
Expand Down

0 comments on commit 5a02508

Please sign in to comment.