Skip to content

Commit

Permalink
upgrade to @epic-web/config
Browse files Browse the repository at this point in the history
  • Loading branch information
kentcdodds committed May 25, 2024
1 parent d5669e7 commit 8c69039
Show file tree
Hide file tree
Showing 14 changed files with 15,009 additions and 12,792 deletions.
20,376 changes: 11,108 additions & 9,268 deletions epicshop/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions epicshop/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"type": "module",
"dependencies": {
"@epic-web/config": "^1.5.3",
"@epic-web/workshop-app": "^4.5.0"
}
}
26 changes: 8 additions & 18 deletions epicshop/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
{
"include": ["**/*.ts", "**/*.tsx", "**/*.js"],
"compilerOptions": {
"lib": ["ES2023"],
"isolatedModules": true,
"esModuleInterop": true,
"module": "ES2022",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"target": "ES2022",
"strict": true,
"noImplicitAny": true,
"allowJs": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"allowImportingTsExtensions": true,
"noEmit": true
}
}
"include": ["**/*.ts", "**/*.tsx", "**/*.js"],
"extends": ["@epic-web/config/typescript"],
"compilerOptions": {
"paths": {
"#*": ["./*"]
}
}
}
50 changes: 12 additions & 38 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,14 @@
/** @type {import('@types/eslint').Linter.Config} */
export default {
files: ['**/*.js', '**/*.ts', '**/*.tsx'],
languageOptions: { parser: await import('@typescript-eslint/parser') },
plugins: {
'@typescript-eslint': (await import('@typescript-eslint/eslint-plugin'))
.default,
'react-hooks': (await import('eslint-plugin-react-hooks')).default,
import: (await import('eslint-plugin-import')).default,
},
rules: {
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
import defaultConfig from '@epic-web/config/eslint'

'@typescript-eslint/consistent-type-imports': [
'warn',
{
prefer: 'type-imports',
disallowTypeAnnotations: true,
fixStyle: 'inline-type-imports',
},
],
'import/no-duplicates': ['warn', { 'prefer-inline': true }],
'import/consistent-type-specifier-style': ['warn', 'prefer-inline'],
'import/order': [
'warn',
{
alphabetize: { order: 'asc', caseInsensitive: true },
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
],
},
],
/** @type {import("eslint").Linter.Config} */
export default [
{ ignores: ['**/babel-standalone.js'] },
...defaultConfig,
{
rules: {
// we leave unused vars around for the exercises
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'off',
},
},
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{/* prettier-ignore */}
<callout-info>
We're going to be working with the URL, so you'll want to pull this one up in

<a target="_blank" href="/app/playground">a separate tab</a>.
</callout-info>

Expand Down
2 changes: 1 addition & 1 deletion exercises/02.state-optimization/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const [state, setState] = useState({ count: 0 })
// ...
setState({ count: 0 }) // <-- will trigger a rerender
setState(previousState => ({
count: previousState.count
count: previousState.count,
})) // <-- will trigger a rerender
setState(previousState => previousState) // <-- will not trigger a rerender
```
Expand Down
4 changes: 2 additions & 2 deletions exercises/05.portals/01.problem.create/posts.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useState } from 'react'
import { getQueryParam, useSearchParams } from './params'
import { ButtonWithTooltip } from './tooltip'
import {
type BlogPost,
generateGradient,
getMatchingPosts,
} from '#shared/blog-posts'
import { getQueryParam, useSearchParams } from './params'
import { ButtonWithTooltip } from './tooltip'

export function MatchingPosts() {
const [searchParams] = useSearchParams()
Expand Down
4 changes: 2 additions & 2 deletions exercises/05.portals/01.solution.create/posts.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useState } from 'react'
import { getQueryParam, useSearchParams } from './params'
import { ButtonWithTooltip } from './tooltip'
import {
type BlogPost,
generateGradient,
getMatchingPosts,
} from '#shared/blog-posts'
import { getQueryParam, useSearchParams } from './params'
import { ButtonWithTooltip } from './tooltip'

export function MatchingPosts() {
const [searchParams] = useSearchParams()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useState } from 'react'
import { getQueryParam, useSearchParams } from './params'
import { ButtonWithTooltip } from './tooltip'
import {
type BlogPost,
generateGradient,
getMatchingPosts,
} from '#shared/blog-posts'
import { getQueryParam, useSearchParams } from './params'
import { ButtonWithTooltip } from './tooltip'

export function MatchingPosts() {
const [searchParams] = useSearchParams()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useState } from 'react'
import { getQueryParam, useSearchParams } from './params'
import { ButtonWithTooltip } from './tooltip'
import {
type BlogPost,
generateGradient,
getMatchingPosts,
} from '#shared/blog-posts'
import { getQueryParam, useSearchParams } from './params'
import { ButtonWithTooltip } from './tooltip'

export function MatchingPosts() {
const [searchParams] = useSearchParams()
Expand Down
Loading

0 comments on commit 8c69039

Please sign in to comment.