Arthur Cachero
04/07/2022, 5:38 PM"@prisma/client": "^3.12.0",
module.exports = {
semi: true,
singleQuote: true,
trailingComma: 'all',
printWidth: 100,
arrowParens: 'always',
tabWidth: 4,
};
Arthur Cachero
04/07/2022, 5:41 PMmodule.exports = {
root: true,
env: {
browser: true,
node: true,
es6: true,
},
parserOptions: { ecmaVersion: 8 }, // to enable features such as async/await
ignorePatterns: ['node_modules/*', '.next/*', '.out/*', '!.prettierrc'], // We don't want to lint generated files nor node_modules, but we want to lint .prettierrc.js (ignored by default by eslint)
extends: ['airbnb', 'airbnb/hooks'],
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
parser: '@typescript-eslint/parser',
settings: {
react: { version: 'detect' },
'import/resolver': {
node: {
extensions: ['.ts', '.tsx', '.js', '.jsx'],
paths: ['.'],
},
},
},
env: {
browser: true,
node: true,
es6: true,
jest: true,
},
extends: [
'airbnb',
'airbnb/hooks',
'plugin:@typescript-eslint/recommended', // TypeScript rules
'plugin:react/recommended', // React rules
'plugin:react-hooks/recommended', // React hooks rules
'plugin:jsx-a11y/recommended', // Accessibility rules
'plugin:prettier/recommended', // Prettier recommended rules
],
rules: {
'react/prop-types': 'off', // We will use TypeScript's types for component props instead
'react/react-in-jsx-scope': 'off', // No need to import React with Next.js
'react/jsx-filename-extension': [1, { extensions: ['.tsx', '.ts'] }],
'react/jsx-props-no-spreading': [1, { custom: 'ignore' }],
'jsx-a11y/anchor-is-valid': 'off', // This rule is not compatible with how Next.js's <Link />
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
'@typescript-eslint/no-unused-vars': ['error'],
'@typescript-eslint/explicit-function-return-type': [
// I suggest this setting for requiring return types on functions only where usefull
'warn',
{
allowExpressions: true,
allowConciseArrowFunctionExpressionsStartingWithVoid: true,
},
],
'prettier/prettier': ['error', {}, { usePrettierrc: true }],
'import/no-extraneous-dependencies': [
'error',
{ devDependencies: ['**/*.test.tsx', '**/*.spec.tsx'] },
],
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
},
},
],
};
Arthur Cachero
04/07/2022, 5:41 PMjanpio
janpio