-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d3577e
commit 3ade7ce
Showing
3 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
out | ||
docs | ||
!.storybook | ||
.archive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
{ | ||
// Configuration for JavaScript files | ||
"extends": [ | ||
"airbnb-base", | ||
"next/core-web-vitals", // Needed to avoid warning in next.js build: 'The Next.js plugin was not detected in your ESLint configuration' | ||
"plugin:prettier/recommended" | ||
], | ||
"rules": { | ||
"prettier/prettier": [ | ||
"error", | ||
{ | ||
"singleQuote": true, | ||
"endOfLine": "auto" | ||
} | ||
] // Avoid conflict rule between Prettier and Airbnb Eslint | ||
}, | ||
"overrides": [ | ||
// Configuration for TypeScript files | ||
{ | ||
"files": ["**/*.ts", "**/*.tsx"], | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"unused-imports", | ||
"tailwindcss", | ||
"simple-import-sort" | ||
], | ||
"extends": [ | ||
"plugin:tailwindcss/recommended", | ||
"airbnb", | ||
"airbnb-typescript", | ||
"next/core-web-vitals", | ||
"plugin:prettier/recommended" | ||
], | ||
"parserOptions": { | ||
"project": "./tsconfig.json" | ||
}, | ||
"rules": { | ||
"prettier/prettier": [ | ||
"error", | ||
{ | ||
"singleQuote": true, | ||
"endOfLine": "auto" | ||
} | ||
], // Avoid conflict rule between Prettier and Airbnb Eslint | ||
"import/extensions": "off", // Avoid missing file extension errors, TypeScript already provides a similar feature | ||
"react/function-component-definition": "off", // Disable Airbnb's specific function type | ||
"react/destructuring-assignment": "off", // Vscode doesn't support automatically destructuring, it's a pain to add a new variable | ||
"react/require-default-props": "off", // Allow non-defined react props as undefined | ||
"react/jsx-props-no-spreading": "off", // _app.tsx uses spread operator and also, react-hook-form | ||
"@typescript-eslint/comma-dangle": "off", // Avoid conflict rule between Eslint and Prettier | ||
"@typescript-eslint/consistent-type-imports": "error", // Ensure `import type` is used when it's necessary | ||
"no-restricted-syntax": [ | ||
"error", | ||
"ForInStatement", | ||
"LabeledStatement", | ||
"WithStatement" | ||
], // Overrides Airbnb configuration and enable no-restricted-syntax | ||
"import/prefer-default-export": "off", // Named export is easier to refactor automatically | ||
"simple-import-sort/imports": "error", // Import configuration for `eslint-plugin-simple-import-sort` | ||
"simple-import-sort/exports": "error", // Export configuration for `eslint-plugin-simple-import-sort` | ||
"import/order": "off", // Avoid conflict rule between `eslint-plugin-import` and `eslint-plugin-simple-import-sort` | ||
"@typescript-eslint/no-unused-vars": "off", | ||
"unused-imports/no-unused-imports": "error", | ||
"unused-imports/no-unused-vars": [ | ||
"error", | ||
{ "argsIgnorePattern": "^_" } | ||
] | ||
} | ||
}, | ||
// Configuration for testing | ||
{ | ||
"files": ["**/*.test.ts", "**/*.test.tsx"], | ||
"plugins": ["jest", "jest-formatting", "testing-library", "jest-dom"], | ||
"extends": [ | ||
"plugin:jest/recommended", | ||
"plugin:jest-formatting/recommended", | ||
"plugin:testing-library/react", | ||
"plugin:jest-dom/recommended" | ||
] | ||
}, | ||
// Configuration for e2e testing (Playwright) | ||
{ | ||
"files": ["**/*.spec.ts"], | ||
"extends": ["plugin:playwright/recommended"] | ||
}, | ||
// Configuration for Storybook | ||
{ | ||
"files": ["*.stories.*"], | ||
"extends": ["plugin:storybook/recommended"], | ||
"rules": { | ||
"import/no-extraneous-dependencies": [ | ||
"error", | ||
{ | ||
"devDependencies": true | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
'*.{js,jsx,ts,tsx}': ['eslint --fix', 'eslint'], | ||
'**/*.ts?(x)': () => 'npm run check-types', | ||
'*.{json,yaml}': ['prettier --write'], | ||
}; |