Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Commit

Permalink
fix: explain how to use with text editors, close #2
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Dec 4, 2017
1 parent e23697f commit 7a65a98
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 27 deletions.
7 changes: 7 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,7 @@
{
"git.ignoreLimitWarning": true,
"eslint.enable": true,
"eslint.alwaysShowStatus": true,
"eslint.autoFixOnSave": true,
"standard.enable": false
}
24 changes: 24 additions & 0 deletions README.md
Expand Up @@ -55,6 +55,30 @@ If using the `react` preset:
npm install --save-dev babel-eslint eslint-plugin-react
```

## Editors

### VSCode

Use plugin [ESLint by Dirk Baeumer](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) to lint and auto fix JS files using ESLint. This repository includes example [.vscode/settings.json](.vscode/settings.json) file.

### Atom

Install package [linter-eslint](https://atom.io/packages/linter-eslint)
(and its dependencies) to enable linting. Go into the settings for this package
and enable "Fix on save" option to auto-fix white space issues and other things.

### Sublime Text

Install [ESLint-Formatter](https://packagecontrol.io/packages/ESLint-Formatter),
then set the following settings:

```json
{
"format_on_save": true,
"debug": true
}
```

## License

This project is licensed under the terms of the [MIT license](/LICENSE.md).
50 changes: 23 additions & 27 deletions index.js
Expand Up @@ -2,25 +2,25 @@ module.exports = {
configs: {
general: {
env: {
commonjs: true,
commonjs: true
},
parserOptions: {
ecmaVersion: 6,
ecmaVersion: 6
},
rules: {
'array-bracket-spacing': ['error', 'never'],
'arrow-parens': ['error', 'always'],
'arrow-spacing': 'error',
'block-spacing': 'error',
'brace-style': ['error', '1tbs', { 'allowSingleLine': true }],
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
'comma-dangle': ['error', 'always-multiline'],
'comma-spacing': 'error',
'curly': ['error', 'multi-line', 'consistent'],
curly: ['error', 'multi-line', 'consistent'],
'constructor-super': 'error',
'default-case': 'error',
'eol-last': 'error',
'eqeqeq': ['error', 'allow-null'],
'indent': ['error', 2, { 'SwitchCase': 1, 'MemberExpression': 0 }],
eqeqeq: ['error', 'allow-null'],
indent: ['error', 2, { SwitchCase: 1, MemberExpression: 0 }],
'key-spacing': 'error',
'keyword-spacing': 'error',
'no-case-declarations': 'error',
Expand Down Expand Up @@ -49,7 +49,7 @@ module.exports = {
'no-invalid-regexp': 'error',
'no-irregular-whitespace': 'error',
'no-mixed-spaces-and-tabs': 'error',
'no-multiple-empty-lines': ['error', { 'max': 2 }],
'no-multiple-empty-lines': ['error', { max: 2 }],
'no-multi-spaces': 'error',
'no-negated-in-lhs': 'error',
'no-new-symbol': 'error',
Expand Down Expand Up @@ -77,8 +77,8 @@ module.exports = {
'prefer-rest-params': 'error',
'prefer-spread': 'error',
'prefer-template': 'error',
'quotes': ['error', 'single'],
'semi': ['error', 'never'],
quotes: ['error', 'single'],
semi: ['error', 'never'],
'semi-spacing': 'error',
'space-before-blocks': 'error',
'space-before-function-paren': 'error',
Expand All @@ -87,42 +87,38 @@ module.exports = {
'space-unary-ops': 'error',
'template-curly-spacing': 'error',
'use-isnan': 'error',
'valid-typeof': 'error',
},
'valid-typeof': 'error'
}
},

tests: {
env: {
mocha: true,
mocha: true
},
globals: {
expect: true,
expect: true
},
plugins: [
'mocha'
],
plugins: ['mocha'],
rules: {
'mocha/handle-done-callback': 'error',
'mocha/no-exclusive-tests': 'error',
'mocha/no-global-tests': 'error'
},
}
},

react: {
env: {
browser: true,
browser: true
},
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
jsx: true
}
},
plugins: [
'react'
],
plugins: ['react'],
rules: {
'react/jsx-curly-spacing': 'error',
'react/jsx-equals-spacing': 'error',
Expand All @@ -137,8 +133,8 @@ module.exports = {
'react/no-unknown-property': 'error',
'react/prefer-es6-class': 'error',
'react/react-in-jsx-scope': 'error',
'react/require-render-return': 'error',
},
},
},
'react/require-render-return': 'error'
}
}
}
}

0 comments on commit 7a65a98

Please sign in to comment.