Skip to content

Commit

Permalink
Export lint rules to .ts so they're auto sorted
Browse files Browse the repository at this point in the history
  • Loading branch information
dsernst committed Feb 6, 2020
1 parent ccd2f20 commit 7ae3610
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
23 changes: 1 addition & 22 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,22 +1 @@
module.exports = {
root: true,
extends: '@react-native-community',
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'sort-keys-fix', 'typescript-sort-keys', 'sort-destructure-keys', 'unicorn'],
rules: {
'lines-between-class-members': ['warn'],
'no-alert': ['off'],
'react/jsx-sort-props': ['warn'],
semi: ['error', 'never'],
'sort-keys-fix/sort-keys-fix': 'warn',
'sort-imports': ['warn', { ignoreDeclarationSort: true }],
'typescript-sort-keys/interface': 2,
'typescript-sort-keys/string-enum': 2,
'react-native/no-inline-styles': ['off'],
'sort-destructure-keys/sort-destructure-keys': 2,
'prefer-const': 2,
'no-warning-comments': [2, { terms: ['nocommit'], location: 'anywhere' }],
'unicorn/expiring-todo-comments': 2,
'no-template-curly-in-string': 1,
},
}
module.exports = require('./lint-rules.ts')
23 changes: 23 additions & 0 deletions lint-rules.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
extends: '@react-native-community',
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'sort-keys-fix', 'typescript-sort-keys', 'sort-destructure-keys', 'unicorn'],
root: true,
rules: {
'lines-between-class-members': ['warn'],
'no-alert': ['off'],
'no-template-curly-in-string': 1,
'no-warning-comments': [2, { location: 'anywhere', terms: ['nocommit'] }],
'prefer-const': 2,
'react-native/no-inline-styles': ['off'],
'react/jsx-sort-props': ['warn'],
semi: ['error', 'never'],
'sort-destructure-keys/sort-destructure-keys': 2,
'sort-imports': ['warn', { ignoreDeclarationSort: true }],
'sort-keys': 2,
'sort-keys-fix/sort-keys-fix': 'warn',
'typescript-sort-keys/interface': 2,
'typescript-sort-keys/string-enum': 2,
'unicorn/expiring-todo-comments': 2,
},
}

0 comments on commit 7ae3610

Please sign in to comment.