Skip to content
This repository was archived by the owner on Mar 30, 2022. It is now read-only.

Commit 79d5824

Browse files
added eslint and prettier
1 parent fb54231 commit 79d5824

File tree

7 files changed

+1263
-10
lines changed

7 files changed

+1263
-10
lines changed

.eslintrc.js

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
3+
extends: [
4+
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
5+
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from @typescript-eslint/eslint-plugin
6+
'airbnb', //Uses airbnb recommended rules
7+
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
8+
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
9+
],
10+
parserOptions: {
11+
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
12+
sourceType: 'module', // Allows for the use of imports
13+
ecmaFeatures: {
14+
jsx: true, // Allows for the parsing of JSX
15+
},
16+
},
17+
env: {
18+
browser: true,
19+
node: true,
20+
jest: true
21+
},
22+
rules: {
23+
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
24+
// e.g. '@typescript-eslint/explicit-function-return-type': 'off',
25+
'no-unused-vars': 'off',
26+
'@typescript-eslint/no-unused-vars': ['error', {
27+
'vars': 'all',
28+
'args': 'after-used',
29+
'ignoreRestSiblings': false
30+
}],
31+
'react/jsx-filename-extension': [1, { 'extensions': ['.js', '.jsx', '.ts', '.tsx'] }],
32+
'@typescript-eslint/no-explicit-any': 'off',
33+
'@typescript-eslint/explicit-function-return-type': 0,
34+
'@typescript-eslint/no-object-literal-type-assertion': ['error', {'allowAsParameter': true}],
35+
'jsx-a11y/anchor-is-valid': [ 'error', {
36+
'components': [ 'Link' ],
37+
'specialLink': [ 'hrefLeft', 'hrefRight' ],
38+
'aspects': [ 'invalidHref', 'preferButton' ]
39+
}],
40+
'react/prop-types': 'off',
41+
'import/no-extraneous-dependencies': [
42+
'error',
43+
{
44+
'devDependencies': true
45+
}
46+
],
47+
'comma-dangle': [
48+
'error',
49+
{
50+
'arrays': 'always-multiline',
51+
'objects': 'always-multiline',
52+
'imports': 'always-multiline',
53+
'exports': 'always-multiline',
54+
'functions': 'never'
55+
}
56+
],
57+
'react-hooks/rules-of-hooks': 'error',
58+
'react-hooks/exhaustive-deps': 'off',
59+
'no-bitwise': 'off'
60+
},
61+
plugins: [
62+
'@typescript-eslint/eslint-plugin',
63+
'react-hooks'
64+
],
65+
settings: {
66+
'import/resolver': {
67+
node: {
68+
extensions: ['.js', '.jsx', '.ts', '.tsx']
69+
}
70+
},
71+
react: {
72+
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
73+
},
74+
},
75+
};

.prettierrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
semi: true,
3+
trailingComma: 'es5',
4+
singleQuote: true,
5+
printWidth: 100,
6+
tabWidth: 2,
7+
};

0 commit comments

Comments
 (0)