Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@mikehardy/lint battles #33

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion template/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ module.exports = {
},
extends: ['@react-native-community'],
LunatiqueCoder marked this conversation as resolved.
Show resolved Hide resolved
parser: '@typescript-eslint/parser',
overrides: [
{
files: ['*.ts?'],
rules: {
'no-undef': 'off',
},
},
],
parserOptions: {
ecmaFeatures: {
jsx: true,
Expand All @@ -22,7 +30,6 @@ module.exports = {
},
rules: {
'@typescript-eslint/no-var-requires': 'off',
indent: ['error', 2],
'linebreak-style': ['error', 'unix'], // https://adaptivepatchwork.com/2012/03/01/mind-the-end-of-your-line/
quotes: ['error', 'single'],
semi: ['error', 'always'],
Expand All @@ -31,5 +38,7 @@ module.exports = {
'react/no-unescaped-entities': 'off',
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
},
};
2 changes: 1 addition & 1 deletion template/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
bracketSpacing: false,
jsxBracketSameLine: true,
bracketSameLine: true,
singleQuote: true,
trailingComma: 'all',
arrowParens: 'avoid',
Expand Down
4 changes: 2 additions & 2 deletions template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"@types/react-native": "^0.66.4",
"@types/react-native-vector-icons": "^6.4.10",
"@types/react-test-renderer": "^17.0.1",
"@typescript-eslint/eslint-plugin": "^4.31.0",
"@typescript-eslint/parser": "^4.31.0",
"@typescript-eslint/eslint-plugin": "^5.4.0",
"@typescript-eslint/parser": "^5.4.0",
"eslint": "^7.32.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.27.0",
Expand Down
3 changes: 0 additions & 3 deletions template/src/__tests__/App-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
*/

import 'react-native';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore -- the import is needed for tests
import React from 'react';
import App from '../app/App';

// Note: test renderer must be required after react-native.
Expand Down
10 changes: 4 additions & 6 deletions template/src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,10 @@ const TopTabNavigator = () => {
};

return (
<SafeAreaProvider style={backgroundStyle}>
<Tab.Navigator initialRouteName="Home" screenOptions={screenOptions}>
<Tab.Screen component={App} key={'Home'} name={'Home'} />
<Tab.Screen component={DetailsTab} key={'Details'} name={'Details'} />
</Tab.Navigator>
</SafeAreaProvider>
<Tab.Navigator initialRouteName="Home" screenOptions={screenOptions}>
<Tab.Screen component={App} key={'Home'} name={'Home'} />
<Tab.Screen component={DetailsTab} key={'Details'} name={'Details'} />
</Tab.Navigator>
);
};

Expand Down