Skip to content

Commit

Permalink
- Add meta.type to rules ("layout" for all rules but `no-callback-l…
Browse files Browse the repository at this point in the history
…iteral` which is set to "suggestion")

- Adhere to standard linting on README example
- Add `.editorconfig` to prep. IDEs for proper indentation before lint checking/fixing
  • Loading branch information
brettz9 committed Apr 11, 2020
1 parent 116eb98 commit dce1c80
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 6 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
; EditorConfig file: https://EditorConfig.org
; Install the "EditorConfig" plugin into your editor to use

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ ESlint Rules for the Standard Linter
### Configuration

```js
{
module.exports = {
rules: {
'standard/object-curly-even-spacing': [2, "either"],
'standard/array-bracket-even-spacing': [2, "either"],
'standard/computed-property-even-spacing': [2, "even"],
'standard/no-callback-literal': [2, ["cb", "callback"]]
'standard/object-curly-even-spacing': [2, 'either'],
'standard/array-bracket-even-spacing': [2, 'either'],
'standard/computed-property-even-spacing': [2, 'even'],
'standard/no-callback-literal': [2, ['cb', 'callback']]
}
}
```
Expand All @@ -36,4 +36,3 @@ There are several rules that were created specifically for the `standard` linter
- `array-bracket-even-spacing` - Like `array-bracket-even-spacing` from ESLint except it has an `either` option which lets you have 1 or 0 spacing padding.
- `computed-property-even-spacing` - Like `computed-property-spacing` around ESLint except is has an `even` option which lets you have 1 or 0 spacing padding.
- `no-callback-literal` - Ensures that we strictly follow the callback pattern with `undefined`, `null` or an error object in the first position of a callback.

1 change: 1 addition & 0 deletions rules/array-bracket-even-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

module.exports = {
meta: {
type: 'layout',
docs: {
url: 'https://github.com/standard/eslint-plugin-standard#rules-explanations'
}
Expand Down
1 change: 1 addition & 0 deletions rules/computed-property-even-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

module.exports = {
meta: {
type: 'layout',
docs: {
url: 'https://github.com/standard/eslint-plugin-standard#rules-explanations'
}
Expand Down
1 change: 1 addition & 0 deletions rules/no-callback-literal.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function couldBeError (node) {

module.exports = {
meta: {
type: 'suggestion',
docs: {
url: 'https://github.com/standard/eslint-plugin-standard#rules-explanations'
}
Expand Down
1 change: 1 addition & 0 deletions rules/object-curly-even-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

module.exports = {
meta: {
type: 'layout',
docs: {
url: 'https://github.com/standard/eslint-plugin-standard#rules-explanations'
}
Expand Down

0 comments on commit dce1c80

Please sign in to comment.