eslint for react native
npm install @cylution/eslint-config-react-native@cylution/eslint-config-react-native``bash`
yarn add -D eslint @cylution/eslint-config-react-nativeUsage
Edit .eslintrc or .eslintrc.js`js`
module.exports = {
extends: ['@cylution/react-native'],
rules: {
'react/jsx-closing-bracket-location': [1, {
nonEmpty: 'tag-aligned',
selfClosing: 'line-aligned',
}]
},
}
> yarn add -D @typescript-eslint/parser typescript
Modify .eslintrc.js`js`
// .eslintrc.js
module.exports = {
extends: ['@cylution/react-native'],
overrides: [
// typescript
{
files: ['.ts', '.tsx'],
parser: '@typescript-eslint/parser',
rules: {
'react/jsx-closing-bracket-location': [1, {
nonEmpty: 'tag-aligned',
selfClosing: 'line-aligned',
}]
},
},
],
}
, please remove node_modules and run npm install or yarn` to reinstall packages