Skip to content

Commit ecba9a1

Browse files
MatthysDevflexbox
authored andcommitted
feat: 🎸 add eslint for RNTL
✅ Closes: #250
1 parent df7b8a5 commit ecba9a1

File tree

5 files changed

+742
-25
lines changed

5 files changed

+742
-25
lines changed

‎challenges/ecosystem/02.md

+1
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ In our case `cargo_capacity`, `cost_in_credits` are not using `camelCase` and we
277277

278278
- [ ] Install [TanStack Query ESLint plugin](https://tanstack.com/query/latest/docs/eslint/eslint-plugin-query).
279279
- [ ] Install [Perfecionist](https://perfectionist.dev/) to enforce a consistent code style across your codebase.
280+
- [ ] Install [eslint-plugin-testing-library](https://callstack.github.io/react-native-testing-library/docs/start/quick-start#eslint-plugin)
280281

281282
Your `.eslintrc.js` file should look like [this](https://raw.githubusercontent.com/flexbox/react-native-bootcamp/main/hackathon/spacecraft/.eslintrc.js)
282283

‎challenges/foundation/04.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ We will use `JSON.stringify()` here to render a `string` version of the data.
7070
function App() {
7171
return (
7272
// <LoginScreen />
73-
<TermsScreen />
73+
<StarshipFeedScreen />
74+
// <TermsScreen />
7475
);
7576
};
7677
```

‎hackathon/spacecraft/.eslintrc.js

+7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ module.exports = {
1010
"plugin:react/jsx-runtime", // Support for React 17 JSX
1111
"plugin:prettier/recommended", // Prettier recommended rules
1212
],
13+
overrides: [
14+
{
15+
// Test files only
16+
extends: ["plugin:testing-library/react"],
17+
files: ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)"],
18+
},
19+
],
1320
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
1421
plugins: [
1522
"react",

‎hackathon/spacecraft/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"@storybook/core-common": "^7.6.10",
7777
"@storybook/react-native": "^7.6.15",
7878
"@storybook/react-native-server": "^6.5.8",
79-
"@tanstack/eslint-plugin-query": "^5.17.20",
79+
"@tanstack/eslint-plugin-query": "^5.53.0",
8080
"@testing-library/jest-native": "^5.4.3",
8181
"@testing-library/react-native": "^12.4.3",
8282
"@types/jest": "^29.5.4",
@@ -97,9 +97,11 @@
9797
"eslint-plugin-import": "^2.29.1",
9898
"eslint-plugin-perfectionist": "^3.3.0",
9999
"eslint-plugin-prettier": "^5.1.3",
100+
"eslint-plugin-query": "^0.9.1",
100101
"eslint-plugin-react": "^7.34.2",
101102
"eslint-plugin-react-native": "^4.1.0",
102103
"eslint-plugin-simple-import-sort": "^12.1.0",
104+
"eslint-plugin-testing-library": "^6.3.0",
103105
"jest": "^29.6.4",
104106
"jest-expo": "~51.0.2",
105107
"prettier": "^3.2.5",

0 commit comments

Comments
 (0)