Skip to content

Commit

Permalink
feat: Add eslint ignore file, configure react correctly, format files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Willem-Jaap committed Mar 30, 2023
1 parent 4bdd878 commit 1348e80
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 37 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/*.js
49 changes: 27 additions & 22 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,48 @@
// @eslint-ignore
module.exports = {
parserOptions: { tsconfigRootDir: __dirname },
parser: "@typescript-eslint/parser",
parserOptions: { project: './tsconfig.json' },
parser: '@typescript-eslint/parser',
env: {
browser: true,
node: true,
},
settings: {
react: {
version: 'detect',
},
},
extends: [
"plugin:eslint:recommended",
"plugin:prettier/recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@typescript-eslint/strict",
'plugin:prettier/recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:@typescript-eslint/strict',
],
rules: {
"prettier/prettier": [
"error",
'prettier/prettier': [
'error',
{
endOfLine: "auto",
quoteProps: "consistent",
endOfLine: 'auto',
quoteProps: 'consistent',
},
],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/consistent-type-imports": "warn",
"@typescript-eslint/ban-types": "error",
"react/hook-use-state": "warn",
"react/self-closing-comp": [
"warn",
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/consistent-type-imports': 'warn',
'@typescript-eslint/ban-types': 'error',
'react/hook-use-state': 'warn',
'react/self-closing-comp': [
'warn',
{
component: true,
html: true,
},
],
"react/function-component-definition": [
'react/function-component-definition': [
2,
{
namedComponents: "arrow-function",
unnamedComponents: "arrow-function",
namedComponents: 'arrow-function',
unnamedComponents: 'arrow-function',
},
],
},
Expand Down
32 changes: 17 additions & 15 deletions prettier.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,27 @@ module.exports = {
bracketSpacing: true,
bracketSameLine: true,
singleQuote: true,
trailingComma: "all",
arrowParens: "avoid",
trailingComma: 'all',
arrowParens: 'avoid',
tabWidth: 4,
printWidth: 100,
quoteProps: "consistent",
quoteProps: 'consistent',
importOrder: [
"^react$",
"^next$",
"<THIRD_PARTY_MODULES>",
"^~core/(.*)$",
"^~components/(.*)$",
"^~functions/(.*)$",
"^~hooks/(.*)$",
"^~styles/(.*)$",
"^~modules/(.*)$",
"^~locales/(.*)$",
"^~types/(.*)$",
"^[./]",
'^react$',
'^next$',
'<THIRD_PARTY_MODULES>',
'^~core/(.*)$',
'^~components/(.*)$',
'^~functions/(.*)$',
'^~hooks/(.*)$',
'^~styles/(.*)$',
'^~modules/(.*)$',
'^~locales/(.*)$',
'^~types/(.*)$',
'^[./]',
],
importOrderSeparation: true,
importOrderSortSpecifiers: true,
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
plugins: [require.resolve('@trivago/prettier-plugin-sort-imports')],
};

0 comments on commit 1348e80

Please sign in to comment.