Skip to content

Commit

Permalink
feat: 🎸 add eslint for RNTL
Browse files Browse the repository at this point in the history
✅ Closes: #250
  • Loading branch information
MatthysDev authored and flexbox committed Sep 17, 2024
1 parent df7b8a5 commit ecba9a1
Show file tree
Hide file tree
Showing 5 changed files with 742 additions and 25 deletions.
1 change: 1 addition & 0 deletions challenges/ecosystem/02.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ In our case `cargo_capacity`, `cost_in_credits` are not using `camelCase` and we

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

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

Expand Down
3 changes: 2 additions & 1 deletion challenges/foundation/04.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ We will use `JSON.stringify()` here to render a `string` version of the data.
function App() {
return (
// <LoginScreen />
<TermsScreen />
<StarshipFeedScreen />
// <TermsScreen />
);
};
```
Expand Down
7 changes: 7 additions & 0 deletions hackathon/spacecraft/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ module.exports = {
"plugin:react/jsx-runtime", // Support for React 17 JSX
"plugin:prettier/recommended", // Prettier recommended rules
],
overrides: [
{
// Test files only
extends: ["plugin:testing-library/react"],
files: ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)"],
},
],
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
plugins: [
"react",
Expand Down
4 changes: 3 additions & 1 deletion hackathon/spacecraft/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"@storybook/core-common": "^7.6.10",
"@storybook/react-native": "^7.6.15",
"@storybook/react-native-server": "^6.5.8",
"@tanstack/eslint-plugin-query": "^5.17.20",
"@tanstack/eslint-plugin-query": "^5.53.0",
"@testing-library/jest-native": "^5.4.3",
"@testing-library/react-native": "^12.4.3",
"@types/jest": "^29.5.4",
Expand All @@ -97,9 +97,11 @@
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-perfectionist": "^3.3.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-query": "^0.9.1",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-react-native": "^4.1.0",
"eslint-plugin-simple-import-sort": "^12.1.0",
"eslint-plugin-testing-library": "^6.3.0",
"jest": "^29.6.4",
"jest-expo": "~51.0.2",
"prettier": "^3.2.5",
Expand Down
Loading

0 comments on commit ecba9a1

Please sign in to comment.