Skip to content

Commit

Permalink
update 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 40de345 commit 1110aa0
Show file tree
Hide file tree
Showing 12 changed files with 955 additions and 3,082 deletions.
16 changes: 8 additions & 8 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"bradlc.vscode-tailwindcss",
"neotan.vscode-auto-restart-typescript-eslint-servers",
"prisma.prisma",
"qwtel.sqlite-viewer"
]
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"bradlc.vscode-tailwindcss",
"neotan.vscode-auto-restart-typescript-eslint-servers",
"prisma.prisma",
"qwtel.sqlite-viewer"
]
}
4 changes: 2 additions & 2 deletions epicshop/fix-watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ const debouncedRun = debounce(run, 200)

// Add event listeners.
watcher
.on('addDir', path => {
.on('addDir', () => {
debouncedRun()
})
.on('unlinkDir', path => {
.on('unlinkDir', () => {
// Only act if path contains two slashes (excluding the leading `./`)
debouncedRun()
})
Expand Down
2 changes: 1 addition & 1 deletion epicshop/fix.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function exists(p) {
try {
fs.statSync(p)
return true
} catch (error) {
} catch {
return false
}
}
Expand Down
34 changes: 17 additions & 17 deletions epicshop/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"include": ["**/*.ts", "**/*.tsx"],
"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"],
"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
}
}
50 changes: 13 additions & 37 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,14 @@
/** @type {import('@types/eslint').Linter.Config} */
export default {
languageOptions: { parser: await import('@typescript-eslint/parser') },
plugins: {
'@typescript-eslint': (await import('@typescript-eslint/eslint-plugin'))
.default,
import: (await import('eslint-plugin-import')).default,
import defaultConfig from '@epic-web/config/eslint'

/** @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',
},
},
ignores: ['node_modules', 'public/babel-standalone.js'],
rules: {
// playwright requires destructuring in fixtures even if you don't use anything 🤷‍♂️
'no-empty-pattern': 'off',
'@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',
],
},
],
},
}
]
2 changes: 1 addition & 1 deletion exercises/01.js-hello-world/01.problem.hello/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@

<!-- 🐨 Append the div to the root div using `append` -->
<!-- 💰 root.append(div) -->
<!-- 📜 https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/append -->
<!-- 📜 https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/append -->
6 changes: 3 additions & 3 deletions exercises/07.forms/01.problem.form/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ for a new user. They'll need a username to start with, so let's just render that
and the submit button for now.

<callout-info>
🦉 You may notice a full page refresh when you submit the form. We'll talk about
this in a future step.
</callout-info>
🦉 You may notice a full page refresh when you submit the form. We'll talk
about this in a future step.
</callout-info>
6 changes: 3 additions & 3 deletions exercises/07.forms/02.problem.action/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ the form data to the current page's URL. We can change this by adding an
Go ahead and add an `action` attribute to the form element.

<callout-info>
🦉 You may notice a full page refresh when you submit the form. We'll talk about
this in a future step.
</callout-info>
🦉 You may notice a full page refresh when you submit the form. We'll talk
about this in a future step.
</callout-info>
6 changes: 3 additions & 3 deletions exercises/07.forms/03.problem.types/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ For us, we need to add types for the password, photo, favorite color, and start
date. Please add inputs for those fields.

<callout-info>
🦉 You may notice a full page refresh when you submit the form. We'll talk about
this in a future step.
</callout-info>
🦉 You may notice a full page refresh when you submit the form. We'll talk
about this in a future step.
</callout-info>
Loading

0 comments on commit 1110aa0

Please sign in to comment.