Skip to content

Commit

Permalink
Cleanup unused console and update formatting (#377)
Browse files Browse the repository at this point in the history
  • Loading branch information
wesbillman authored Sep 12, 2023
1 parent deddbd8 commit fe0fd35
Show file tree
Hide file tree
Showing 61 changed files with 531 additions and 1,204 deletions.
4 changes: 2 additions & 2 deletions console/client/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
src/protos/**/*
dist/**/*
.playwright/**/*
playwright.config.ts
scripts/**/*
tailwind.config.js
161 changes: 25 additions & 136 deletions console/client/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,147 +1,36 @@
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
allowImportExportEverywhere: true,
project: true,
tsconfigRootDir: __dirname,
},
parser: '@typescript-eslint/parser',
env: {
browser: true,
node: true,
es6: true,
mocha: true,
},
globals: {
convertStoriesToJestCases: 'readonly',
},
plugins: ['react'],
extends: [
'eslint:recommended',
'plugin:compat/recommended',
'plugin:@typescript-eslint/recommended-type-checked',
'prettier',
],
ignorePatterns: ['**/dist/*'],
rules: {
strict: 0,
/* START: Prettier equivalent rules */
'max-len': [
'error',
{
ignoreComments: true,
tabWidth: 2, // Prettier:Tab Width
ignoreTemplateLiterals: true,
code: 180, // Prettier:Max length
},
],
'no-tabs': ['error'], // Prettier: Tabs
semi: ['error', 'never'], // Prettier: Semicolons
quotes: [
'error',
'single',
{
// Prettier: Quotes
avoidEscape: true,
allowTemplateLiterals: true,
},
],
'quote-props': ['error', 'as-needed'], // Prettier: Quote Props
'comma-dangle': [
'error',
{
// Prettier: Trailing Commas
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
exports: 'always-multiline',
functions: 'never',
},
],
'array-bracket-spacing': ['error', 'never'], // Prettier: Bracket Spacing
'object-curly-spacing': ['error', 'never'], // Prettier: Bracket Spacing
'arrow-parens': ['error', 'as-needed'], // Prettier: Arrow Function Parentheses
'eol-last': ['error'], // Prettier: End of Line
// Prettier: JSX
'jsx-quotes': ['error', 'prefer-single'], // Prettier: JSX Quotes
'react/jsx-tag-spacing': ['error'], // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md
'react/jsx-closing-bracket-location': ['error', 'line-aligned'], // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-closing-bracket-location.md
'react/jsx-indent-props': [2, 2], // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md
/* END: Prettier equivalent rules */
/* Start: JS/TS quality rules */
'react/jsx-key': [
'error',
{
checkFragmentShorthand: true,
checkKeyMustBeforeSpread: false,
warnOnDuplicates: true,
},
], // https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-key.md
'no-prototype-builtins': 0,
'func-names': [
'error',
'always',
{
generators: 'never',
},
],
'no-console': [
'error',
{
allow: ['warn', 'error'],
},
],
'no-return-assign': ['error'],
'class-methods-use-this': [
'error',
{
exceptMethods: ['render'],
},
],
'no-use-before-define': ['error'],
'no-unneeded-ternary': ['error'],
'@typescript-eslint/no-use-before-define': ['error'],
'@typescript-eslint/ban-ts-comment': [
2,
{
'ts-ignore': 'allow-with-description',
},
],
'@typescript-eslint/no-unused-vars': [
'error',
{argsIgnorePattern: '^_', varsIgnorePattern: '^_'},
],
/* End: JS/TS quality rules */
es2021: true,
},
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:react/recommended', 'prettier'],
overrides: [
{
files: ['**/*.spec.*'],
extends: ['plugin:@typescript-eslint/disable-type-checked'],
rules: {
'func-names': 0,
'no-console': 0,
'no-shadow': 0,
'no-return-assign': 0,
'no-global-assign': 0,
'@typescript-eslint/no-non-null-assertion': 0,
env: {
node: true,
},
},
{
files: ['**/*.svg.tsx'],
rules: {
'max-len': 0,
},
},
{
files: ['**/*.cjs', '**/*.js'],
extends: ['plugin:@typescript-eslint/disable-type-checked'],
rules: {
'@typescript-eslint/no-var-requires': 0,
'no-undef': 0,
'func-names': 0,
files: ['.eslintrc.{js,cjs}'],
parserOptions: {
sourceType: 'script',
},
},
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'react'],
rules: {
'react/react-in-jsx-scope': 'off',
'react/jsx-uses-react': 'off',
'func-style': ['error', 'expression'],
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
},
settings: {
react: {
version: 'detect',
},
},
}
8 changes: 3 additions & 5 deletions console/client/.jest/expect-no-interdependencies.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {expect} from '@jest/globals'
import { expect } from '@jest/globals'

expect.extend({
noInterdependencies(received) {
Expand All @@ -7,14 +7,12 @@ expect.extend({
return {
pass: false,
message: () =>
'Expected no component interdependencies but found: \n' +
`'${received.text}' in ${received.file}`,
'Expected no component interdependencies but found: \n' + `'${received.text}' in ${received.file}`,
}
}
return {
pass: true,
message: () =>
'Expected not to receive any interdependencies local to the components package.',
message: () => 'Expected not to receive any interdependencies local to the components package.',
}
},
})
4 changes: 3 additions & 1 deletion console/client/.jest/setup.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
import '@testing-library/jest-dom/jest-globals'
import * as React from 'react'
import './expect-no-interdependencies.js'

global.React = React
1 change: 0 additions & 1 deletion console/client/.prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
src/protos/**/*
dist/**/*
.playwright/**/*
14 changes: 1 addition & 13 deletions console/client/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,5 @@
"semi": false,
"singleQuote": true,
"jsxSingleQuote": true,
"trailingComma": "es5",
"bracketSpacing": false,
"bracketSameLine": false,
"arrowParens": "avoid",
"singleAttributePerLine": true,
"overrides": [
{
"files": ["*.(t|j)sx?"],
"options": {
"parser": "typescript"
}
}
]
"printWidth": 120
}
16 changes: 3 additions & 13 deletions console/client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,13 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>FTL</title>
<link
rel="icon"
href="favicon.ico"
type="image/x-icon"
/>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
</head>

<body class="bg-slate-200 dark:bg-slate-800">
<div id="root"></div>
<script
type="module"
src="/src/main.tsx"
></script>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading

0 comments on commit fe0fd35

Please sign in to comment.