Skip to content

Commit 7432186

Browse files
authored
Merge pull request #3888 from project-koku/release_prod-stable.94128
Deployment commit for prod-stable
2 parents 8d85b40 + 9eadaa9 commit 7432186

File tree

45 files changed

+404
-273
lines changed

Some content is hidden

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

45 files changed

+404
-273
lines changed
File renamed without changes.
File renamed without changes.

eslint.config.mjs

+205
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
2+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
3+
import formatjs from "eslint-plugin-formatjs";
4+
import patternflyReact from "eslint-plugin-patternfly-react";
5+
import react from "eslint-plugin-react";
6+
import simpleImportSort from "eslint-plugin-simple-import-sort";
7+
import sortKeysFix from "eslint-plugin-sort-keys-fix";
8+
import testingLibrary from "eslint-plugin-testing-library";
9+
import globals from "globals";
10+
import path from "node:path";
11+
import { fileURLToPath } from "node:url";
12+
import js from "@eslint/js";
13+
import { FlatCompat } from "@eslint/eslintrc";
14+
// import prettier from "eslint-plugin-prettier";
15+
16+
const __filename = fileURLToPath(import.meta.url);
17+
const __dirname = path.dirname(__filename);
18+
const compat = new FlatCompat({
19+
baseDirectory: __dirname,
20+
recommendedConfig: js.configs.recommended,
21+
allConfig: js.configs.all
22+
});
23+
24+
export default [{
25+
ignores: [
26+
'**/node_modules',
27+
'**/public',
28+
'**/dist',
29+
'**/.DS_Store',
30+
'**/coverage',
31+
'**/npm-debug.log',
32+
'**/yarn-debug.log',
33+
'**/yarn-error.log',
34+
'**/.idea',
35+
'**/.project',
36+
'**/.classpath',
37+
'**/.c9',
38+
'**/*.launch',
39+
'**/.settings',
40+
'**/*.sublime-workspace',
41+
'**/.history',
42+
'**/.vscode',
43+
'**/*.swp',
44+
'**/*.test.ts',
45+
'**/*.test.tsx',
46+
],
47+
}, ...fixupConfigRules(compat.extends(
48+
'@redhat-cloud-services/eslint-config-redhat-cloud-services',
49+
'eslint:recommended', // Extended by eslint-config-redhat-cloud-services
50+
'plugin:@typescript-eslint/recommended',
51+
'plugin:react/recommended', // Extended by eslint-config-redhat-cloud-services
52+
'plugin:react-hooks/recommended',
53+
)), {
54+
plugins: {
55+
'@typescript-eslint': fixupPluginRules(typescriptEslint),
56+
formatjs,
57+
'patternfly-react': patternflyReact,
58+
// prettier, // Plugin defined by eslint-config-redhat-cloud-services
59+
react: fixupPluginRules(react),
60+
'simple-import-sort': simpleImportSort,
61+
'sort-keys-fix': sortKeysFix,
62+
'testing-library': testingLibrary,
63+
},
64+
65+
languageOptions: {
66+
globals: {
67+
...globals.browser,
68+
...globals.node,
69+
afterEach: 'readonly',
70+
beforeEach: 'readonly',
71+
describe: 'readonly',
72+
expect: 'readonly',
73+
global: 'writable',
74+
insights: 'readonly',
75+
it: 'readonly',
76+
jest: 'readonly',
77+
mount: 'readonly',
78+
render: 'readonly',
79+
require: 'readonly',
80+
test: 'readonly',
81+
shallow: 'readonly',
82+
},
83+
84+
ecmaVersion: 7,
85+
sourceType: 'module',
86+
87+
parserOptions: {
88+
ecmaFeatures: {
89+
jsx: true,
90+
},
91+
},
92+
},
93+
94+
settings: {
95+
react: {
96+
version: 'detect',
97+
},
98+
},
99+
100+
rules: {
101+
'@typescript-eslint/adjacent-overload-signatures': 'error',
102+
'@typescript-eslint/array-type': 'error',
103+
'@typescript-eslint/ban-types': 'error',
104+
'@typescript-eslint/camelcase': 'off',
105+
'@typescript-eslint/consistent-type-assertions': 'error',
106+
'@typescript-eslint/consistent-type-definitions': 'error',
107+
'@typescript-eslint/consistent-type-imports': 'error',
108+
'@typescript-eslint/explicit-function-return-type': 'off',
109+
'@typescript-eslint/explicit-module-boundary-types': 'off',
110+
'@typescript-eslint/explicit-member-accessibility': 'off',
111+
'@typescript-eslint/indent': 'off',
112+
'@typescript-eslint/no-empty-function': 'off',
113+
'@typescript-eslint/no-empty-interface': 'off',
114+
'@typescript-eslint/no-misused-new': 'error',
115+
'@typescript-eslint/no-namespace': 'error',
116+
'@typescript-eslint/no-var-requires': 'off',
117+
'@typescript-eslint/prefer-for-of': 'error',
118+
'@typescript-eslint/prefer-function-type': 'error',
119+
'@typescript-eslint/prefer-namespace-keyword': 'error',
120+
'@typescript-eslint/no-explicit-any': 'off',
121+
'@typescript-eslint/no-use-before-define': 'off',
122+
'@typescript-eslint/no-inferrable-types': 'off',
123+
'@typescript-eslint/triple-slash-reference': 'error',
124+
'@typescript-eslint/unified-signatures': 'error',
125+
126+
'arrow-parens': [2, 'as-needed', {
127+
requireForBlockBody: false,
128+
}],
129+
130+
'constructor-super': 'error',
131+
curly: 'error',
132+
'dot-notation': 'error',
133+
eqeqeq: ['error', 'smart'],
134+
// 'formatjs/enforce-default-message': 'error', // Not working -- see https://github.com/formatjs/formatjs/issues/4388
135+
// 'formatjs/enforce-description': 'error',
136+
// 'formatjs/enforce-id': 'error',
137+
'guard-for-in': 'error',
138+
'max-classes-per-file': ['error', 1],
139+
'max-len': 'off',
140+
'no-bitwise': 'error',
141+
'no-caller': 'error',
142+
'no-cond-assign': 'error',
143+
'no-console': 'error',
144+
'no-debugger': 'error',
145+
'no-empty': 'error',
146+
'no-eval': 'error',
147+
'no-new-wrappers': 'error',
148+
'no-prototype-builtins': 'off',
149+
150+
'no-restricted-imports': ['error', {
151+
patterns: ['../*/**'],
152+
}],
153+
154+
'no-shadow': 'error',
155+
'no-throw-literal': 'error',
156+
'no-trailing-spaces': 'off',
157+
'no-undef': 'off',
158+
'no-undef-init': 'error',
159+
'no-unsafe-finally': 'error',
160+
161+
'no-unused-expressions': ['error', {
162+
allowTernary: true,
163+
allowShortCircuit: true,
164+
}],
165+
166+
'no-unused-labels': 'error',
167+
'no-var': 'error',
168+
'object-shorthand': 'error',
169+
'one-var': ['error', 'never'],
170+
'patternfly-react/no-anonymous-functions': 0,
171+
'prefer-const': 'error',
172+
'prettier/prettier': 'error',
173+
radix: ['error', 'as-needed'],
174+
'react-hooks/exhaustive-deps': 0,
175+
'react/display-name': 0,
176+
177+
'react/no-unescaped-entities': ['error', {
178+
forbid: ['>', '}'],
179+
}],
180+
181+
'react/no-unknown-property': ['error', {
182+
ignore: ['key'],
183+
}],
184+
185+
'react/prop-types': 0,
186+
'simple-import-sort/imports': 'error',
187+
'spaced-comment': 'error',
188+
'rulesdir/disallow-pf-migrated-components': 'off',
189+
'rulesdir/forbid-pf-relative-imports': 'off',
190+
'testing-library/await-async-queries': 'error',
191+
'testing-library/no-await-sync-queries': 'error',
192+
// 'testing-library/no-debugging-utils': 'warn', // Not working -- see https://eslint.org/docs/latest/use/troubleshooting/v9-rule-api-changes
193+
'testing-library/no-dom-import': 'off',
194+
'use-isnan': 'error',
195+
},
196+
}, {
197+
files: ['src/locales/messages.ts'],
198+
199+
rules: {
200+
'sort-keys-fix/sort-keys-fix': 'error',
201+
},
202+
}, ...compat.extends('plugin:testing-library/react').map(config => ({
203+
...config,
204+
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
205+
}))];

0 commit comments

Comments
 (0)