Skip to content

Commit 50fed62

Browse files
trock-broadinstGhost-in-a-Jar
trock-broadinst
andauthoredMay 2, 2023
[UIE-77] add airbnb eslint and prettier (#3902)
Co-authored-by: Tristan Garwood <[email protected]>
1 parent 2182be3 commit 50fed62

File tree

652 files changed

+64787
-49644
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

652 files changed

+64787
-49644
lines changed
 

‎.eslintignore

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
.yarn
2-
node_modules
1+
*.json
2+
*.yaml
3+
*.yml
4+
*.md
35
*.min.js
46
.pnp.*js
57
build
8+
public
9+
.eslintrc.js
10+
.hooks
11+
.yarn
12+
node_modules
13+
.vscode

‎.eslintrc.js

+101-127
Original file line numberDiff line numberDiff line change
@@ -1,139 +1,113 @@
1-
/* eslint-disable quote-props */
21
module.exports = {
3-
'plugins': ['lodash-fp', 'simple-import-sort'],
4-
'extends': 'react-app',
5-
'settings': {
2+
extends: ['airbnb-typescript-prettier'],
3+
parserOptions: {
4+
project: './tsconfig.json',
5+
},
6+
settings: {
67
'import/resolver': {
78
'eslint-import-resolver-custom-alias': {
8-
'alias': {
9-
'src': './src',
10-
'types': './types'
9+
alias: {
10+
src: './src',
11+
types: './types',
1112
},
12-
'extensions': ['.js', '.ts']
13-
}
14-
}
13+
extensions: ['.js', '.ts'],
14+
},
15+
},
1516
},
16-
'rules': {
17-
// Best Practices
18-
'no-multi-spaces': 'warn',
19-
'require-await': 'warn',
20-
// Stylistic Issues
21-
'array-bracket-newline': ['warn', 'consistent'],
22-
'array-bracket-spacing': 'warn',
23-
'block-spacing': 'warn',
24-
'brace-style': ['warn', '1tbs', { 'allowSingleLine': true }],
25-
'camelcase': ['warn', { 'properties': 'never' }],
26-
'comma-dangle': ['warn', 'only-multiline'],
27-
'comma-spacing': 'warn',
28-
'comma-style': 'warn',
29-
'computed-property-spacing': 'warn',
30-
'eol-last': 'warn',
31-
'func-call-spacing': 'warn',
32-
'implicit-arrow-linebreak': 'warn',
33-
'indent': ['warn', 2, { 'SwitchCase': 1, 'CallExpression': { 'arguments': 1 } }],
34-
'key-spacing': 'warn',
35-
'keyword-spacing': 'warn',
36-
'lines-between-class-members': 'warn',
37-
'@typescript-eslint/member-delimiter-style': ['warn', { 'multiline': { 'delimiter': 'none' } }],
38-
'no-floating-decimal': 'warn',
39-
'no-lonely-if': 'warn',
40-
'no-multi-assign': 'warn',
41-
'no-multiple-empty-lines': 'warn',
42-
'no-trailing-spaces': 'warn',
43-
'no-unneeded-ternary': 'warn',
44-
'no-unused-vars': 'off', // prefer @typescript-eslint/no-unused-vars
45-
'@typescript-eslint/no-unused-vars': [
46-
'warn', {
47-
'vars': 'all',
48-
'args': 'all',
49-
'argsIgnorePattern': '^_|^props',
50-
'ignoreRestSiblings': true,
51-
}
52-
],
53-
'no-whitespace-before-property': 'warn',
54-
'nonblock-statement-body-position': 'warn',
55-
'object-curly-newline': ['warn', { 'multiline': true, 'consistent': true }],
56-
'object-curly-spacing': ['warn', 'always'],
57-
'one-var': ['warn', 'never'],
58-
'operator-linebreak': ['warn', 'after'],
59-
'padded-blocks': ['warn', 'never'],
60-
'quote-props': ['warn', 'as-needed'],
61-
'quotes': ['warn', 'single', { 'avoidEscape': true }],
62-
'semi': ['warn', 'never'],
63-
'space-before-blocks': 'warn',
64-
'space-before-function-paren': ['warn', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always' }],
65-
'space-in-parens': 'warn',
66-
'space-infix-ops': 'warn',
67-
68-
// ES6
69-
'arrow-parens': ['warn', 'as-needed'],
70-
'arrow-spacing': 'warn',
71-
'no-duplicate-imports': 'warn',
72-
'no-restricted-syntax': [
73-
'warn',
74-
{ 'selector': 'TSEnumDeclaration', 'message': 'Use a union of literals instead of an enum' },
75-
{ 'selector': 'JSXElement', 'message': 'Use react-hyperscript-helpers instead of JSX' }
76-
],
77-
// TODO: Set 'variables' to 'true' after fixing the existing issues
78-
'no-use-before-define': ['warn', { 'functions': true, 'classes': true, 'variables': false }],
79-
'no-useless-rename': 'warn',
80-
'no-var': 'warn',
81-
'object-shorthand': 'warn',
82-
'prefer-arrow-callback': 'warn',
83-
'prefer-const': 'warn',
84-
'prefer-template': 'warn',
85-
'prefer-rest-params': 'warn',
86-
'prefer-spread': 'warn',
87-
'rest-spread-spacing': 'warn',
88-
'template-curly-spacing': 'warn',
89-
'vars-on-top': 'warn',
90-
91-
92-
'lodash-fp/consistent-name': ['warn', '_'],
93-
'lodash-fp/no-argumentless-calls': 'warn',
94-
'lodash-fp/no-chain': 'warn',
95-
'lodash-fp/no-extraneous-args': 'warn',
96-
'lodash-fp/no-extraneous-function-wrapping': 'warn',
97-
'lodash-fp/no-extraneous-iteratee-args': 'warn',
98-
// 'lodash-fp/no-extraneous-partials': 'warn', // available in eslint-plugin-lodash-fp 2.2.0+
99-
'lodash-fp/no-partial-of-curried': 'warn',
100-
'lodash-fp/no-single-composition': 'warn',
101-
'lodash-fp/no-submodule-destructuring': 'warn',
102-
'lodash-fp/no-unused-result': 'warn',
103-
'lodash-fp/prefer-compact': 'warn',
104-
'lodash-fp/prefer-composition-grouping': 'warn',
105-
'lodash-fp/prefer-flat-map': 'warn',
106-
'lodash-fp/prefer-get': 'warn',
107-
'lodash-fp/prefer-identity': ['warn', { 'arrowFunctions': false }],
108-
'lodash-fp/preferred-alias': 'warn',
109-
'lodash-fp/use-fp': 'warn',
110-
17+
rules: {
18+
'import/prefer-default-export': 'off',
19+
'simple-import-sort/imports': 'warn',
20+
quotes: [2, 'single', { avoidEscape: true }],
21+
'prettier/prettier': ['error', { singleQuote: true }],
11122

112-
'react/default-props-match-prop-types': 'warn',
113-
'react/no-children-prop': 'warn',
114-
'react/no-unused-state': 'warn',
23+
// TODO: ticket all of these to be enabled or explain why they are disabled
24+
'react/destructuring-assignment': 'off',
25+
'react/forbid-prop-types': 'off',
26+
'react/hooks/exhaustive-deps': 'off',
27+
'react/prop-types': 'off',
28+
'react/require-default-props': 'off',
29+
'react/sort-comp': 'off',
30+
'react/static-property-placement': 'off',
11531

116-
'react-hooks/rules-of-hooks': 'warn',
117-
'react-hooks/exhaustive-deps': 'warn',
32+
'import/extensions': 'off',
33+
'import/named': 'off',
34+
'import/no-cycle': 'off',
35+
'import/no-extraneous-dependencies': 'off',
36+
'import/no-named-as-default': 'off',
37+
'import/no-named-as-default-member': 'off',
38+
'import/no-relative-parent-imports': 'off',
11839

119-
'simple-import-sort/imports': 'warn',
40+
'@typescript-eslint/ban-ts-comment': 'off',
41+
'@typescript-eslint/ban-types': 'off',
42+
'@typescript-eslint/default-param-last': 'off',
43+
'@typescript-eslint/naming-convention': 'off',
44+
'@typescript-eslint/no-empty-function': 'off',
45+
'@typescript-eslint/no-explicit-any': ['off'],
46+
'@typescript-eslint/no-implied-eval': 'off',
47+
'@typescript-eslint/no-non-null-assertion': 'off',
48+
'@typescript-eslint/no-shadow': 'off',
49+
'@typescript-eslint/no-throw-literal': 'off',
50+
'@typescript-eslint/no-unused-expressions': 'off',
51+
'@typescript-eslint/no-use-before-define': 'off',
52+
'@typescript-eslint/no-var-requires': 'off',
53+
'@typescript-eslint/return-await': 'off',
54+
'@typescript-eslint/strict-boolean-expressions': 'off', // TODO: should be 'warn',
12055

121-
'import/named': 'warn',
122-
'import/newline-after-import': ['warn', { 'count': 2 }],
123-
'import/no-anonymous-default-export': ['warn', { 'allowObject': true }],
124-
'import/no-internal-modules': ['warn', {
125-
'forbid': ['src/components/common/*']
126-
}],
127-
'import/no-unresolved': 'warn',
56+
'class-methods-use-this': 'off',
57+
'consistent-return': 'off',
58+
'default-param-last': 'off',
59+
'func-names': 'off',
60+
'implicit-arrow-linebreak': 'off',
61+
'max-len': 'off', // TODO: should be: ['warn', { code: 120 }],
62+
'no-await-in-loop': 'off',
63+
'no-case-declarations': 'off',
64+
'no-constant-condition': 'off',
65+
'no-console': 'off',
66+
'no-dupe-keys': 'off',
67+
'no-empty': 'off',
68+
'no-continue': 'off',
69+
'no-nested-ternary': 'off',
70+
'no-param-reassign': 'off',
71+
'no-plusplus': 'off',
72+
'no-promise-executor-return': 'off',
73+
'no-restricted-syntax': 'off',
74+
'no-return-await': 'off',
75+
'no-undef': 'off',
76+
'no-underscore-dangle': 'off',
77+
'no-unused-expressions': 'off',
78+
'no-void': 'off',
79+
'operator-linebreak': 'off',
80+
'prefer-destructuring': 'off',
81+
'prefer-promise-reject-errors': 'off',
82+
'prefer-regex-literals': 'off',
83+
radix: 'off',
84+
'symbol-description': 'off',
85+
//
12886

129-
'no-debugger': 'warn'
87+
'no-unsafe-optional-chaining': 'warn',
88+
'@typescript-eslint/no-unused-vars': [
89+
'warn',
90+
{
91+
vars: 'all',
92+
args: 'all',
93+
argsIgnorePattern: '_|^_|^props',
94+
ignoreRestSiblings: true,
95+
},
96+
],
13097
},
131-
'overrides': [
98+
overrides: [
99+
{
100+
files: ['**/*.test.ts', '**/*.test.js'],
101+
env: {
102+
jest: true,
103+
},
104+
},
132105
{
133-
'files': 'src/**/*.{js,ts}',
134-
'rules': {
135-
'no-console': ['warn', { 'allow': ['assert', 'error'] }]
136-
}
137-
}
138-
]
139-
}
106+
files: 'src/**/*.{js,ts}',
107+
rules: {
108+
// 'no-console': ['warn', { allow: ['assert', 'error'] }],//TODO: should be enabled
109+
},
110+
},
111+
],
112+
plugins: ['lodash-fp', 'simple-import-sort'],
113+
};

0 commit comments

Comments
 (0)
Please sign in to comment.