1.0.8 • Published 2 years ago

@cylution/eslint-config-react v1.0.8

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

@cylution/eslint-config-react

yarn add -D eslint @cylution/eslint-config-react

Usage

Edit .eslintrc or .eslintrc.js

module.exports = {
  extends: ['@cylution/react'],
  rules: {
    'react/jsx-closing-bracket-location': [1, {
      nonEmpty: 'tag-aligned',
      selfClosing: 'line-aligned',
    }]
  },
}

Extra step for typescript

npm i -D @typescript-eslint/parser typescript

yarn add -D @typescript-eslint/parser typescript

Modify .eslintrc.js

// .eslintrc.js
module.exports = {
  extends: ['@cylution/react'],
  overrides: [
    // typescript
    {
      files: ['*.ts', '*.tsx'],
      parser: '@typescript-eslint/parser',
      rules: {
        'react/jsx-closing-bracket-location': [1, {
          nonEmpty: 'tag-aligned',
          selfClosing: 'line-aligned',
        }]
      },
    },
  ],
}

Note

If you get error message like: Could not load/find module eslint-blahblah, please remove node_modules and run npm install or yarn to reinstall packages