Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console refresh #843

Merged
merged 10 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
44 changes: 33 additions & 11 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
# Packages
bin/
build/
dist/
lib/

# *
# !package.json
# !yarn.lock
# !packages/
# !node_modules/
# !jes
.storybook/
stories-intro/
Dockerfile*
.dockerignore
README*
# yarn related
node_modules/**
.pnp.*
**/.yarn/*
!**/.yarn/plugins
!**/.yarn/releases
!**/.yarn/sdks
!**/.yarn/versions
# patches contain the patchfiles which have been generated with the `yarn patch-commit` command.
# We always want them in repository, since they are necessary to install dependencies.
!.yarn/patches

# results of tsc build
tsconfig.tsbuildinfo

# result of linting
.eslintcache

#coverage
.coverage

# misc
.DS_Store
.srl
yarn-error.log

# generated data
certificate
25 changes: 17 additions & 8 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
LICENSE
src/generated/
.github/
.dist/
# ignore infrastracture
node_modules/
bin/
build/
dist/
lib/
node_modules/
tsd/
webpack.common.config.ts
webpack.dev.config.ts
webpack.prod.config.ts

# generated files
generated/
gen/

# webpack settings
webpack.*

# Storybook md pages
stories-intro/

# package generator
scripts/generator
163 changes: 73 additions & 90 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
jest: true,
},
root: true,
globals: {
// global variables, that should be assumed by eslint as defined
JSX: true,
RequiredNonNullable: true,
Dictionary: true,
NodeJS: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
Expand All @@ -20,101 +22,89 @@ module.exports = {
sourceType: 'module',
},
extends: ['plugin:react/recommended', 'airbnb', 'prettier'],
plugins: ['react', '@typescript-eslint'],
plugins: ['custom-rules', 'react', '@typescript-eslint', 'import'],
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
'import/core-modules': [
'@clients/locale',
'@clients/ui-atoms',
'@clients/primitives',
'@clients/theme',
'@clients/common',
'@clients/db',
],
},
rules: {
/**
* Rules we don't want to be enabled
* "off" or 0: turn off the rule completely; "warn" or 1; "error" or 2
*/
// "off" or 0 - turn the rule off; "warn" or 1; "error" or 2
'arrow-body-style': 'off',
'import/extensions': 'off',
'import/no-unresolved': 'off',
'import/prefer-default-export': 'off',
'react/jsx-boolean-value': 'off',
'react/jsx-filename-extension': [2, { extensions: ['.jsx', '.tsx'] }],
'lines-between-class-members': [
'consistent-return': 'off',
'no-use-before-define': 'warn',
'no-shadow': 'off',
'no-nested-ternary': 'off',
'no-unused-vars': 'off',
'no-redeclare': 'off',
'prefer-destructuring': 'warn',
'prefer-promise-reject-errors': 'warn',
'no-restricted-syntax': 'warn',
'guard-for-in': 'warn',
'no-param-reassign': 'warn',
'no-unused-expressions': 'warn',
'no-continue': 'warn',
'no-restricted-globals': 'warn',
'default-case': 'warn',
'no-underscore-dangle': 'warn',
'no-return-assign': 'warn',
'no-throw-literal': 'warn',

'no-restricted-imports': [
'error',
'always',
{ exceptAfterSingleLine: true },
{
patterns: [
{
group: ['@mui/styles', '@naterial/styles'],
importNames: ['makeStyles'],
message:
"MUIv5 styles are incompatible with JSS, use 'styled' pattern or 'sx' prop instead.",
},
],
},
],
'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],

// typescript specific
'@typescript-eslint/no-shadow': 'off',
// disabled to let "@typescript-eslint/*" rules do it's job
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': [
'warn',
{ ignoreDeclarationMerge: true },
], // still will warn on exporting enums :(

/**
* Up for discussion
* */
'react/function-component-definition': 'off',
'react/destructuring-assignment': 'off',

/**
* temporarily off or warn
* */
// some setup of eslint or prettier needed
'import/no-extraneous-dependencies': 'off', // 715 - !important
'react/jsx-props-no-spreading': 'off', // 119
'@typescript-eslint/no-redeclare': ['warn', { ignoreDeclarationMerge: true }], // still will warn on exporting enums :(

// classic
'no-use-before-define': 'off', // 49
'no-shadow': 'off', // 104
'no-param-reassign': 'off', // 28
'no-unused-expressions': 'warn', // 5
'prefer-destructuring': 'off', // 34
'no-empty-function': 'off',
'no-useless-constructor': 'warn', // 1
'no-useless-computed-key': 'off',
'no-restricted-syntax': 'off',
'no-else-return': 'off',
'no-plusplus': 'off',
'no-var': 'off',
'no-continue': 'off',
'no-unsafe-optional-chaining': 'off',
'no-throw-literal': 'off',
'no-lonely-if': 'off',
'no-useless-return': 'off',
'no-return-await': 'off',
'no-nested-ternary': 'off',
'no-restricted-globals': 'off',
'no-return-assign': 'off',
'no-await-in-loop': 'off',
'no-undef-init': 'off',
'no-unneeded-ternary': 'off',
'no-underscore-dangle': 'off',
'prefer-object-spread': 'off',
'prefer-template': 'off',
'default-case': 'off',
'valid-typeof': 'off',
'object-shorthand': 'off',
'operator-assignment': 'off',
'array-callback-return': 'off',
'global-require': 'off',
'dot-notation': 'off',
'guard-for-in': 'off',
'one-var': 'off',
'vars-on-top': 'off',
'consistent-return': 'off',
'prefer-promise-reject-errors': 'off',
'prefer-arrow-callback': 'off',
'func-names': 'off',
eqeqeq: 'warn', // 12

// import
'import/no-dynamic-require': 'warn', // 1
'import/extensions': 'off',
'import/prefer-default-export': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-cycle': 2,
'import/no-unresolved': 'off',
'import/no-unused-modules': [1, { unusedExports: true }],

// up for discussion
'react/function-component-definition': 'off',
eqeqeq: 'warn', // 12

// react
'react/destructuring-assignment': 'off',
'react/jsx-props-no-spreading': 'off',
'react/jsx-filename-extension': [
2,
{
extensions: ['.jsx', '.tsx'],
},
],
'react/button-has-type': 'off', // 5
'react/jsx-no-useless-fragment': 'off', // 15
'react/no-access-state-in-setstate': 'warn', // 2
Expand All @@ -136,32 +126,25 @@ module.exports = {
'jsx-a11y/no-noninteractive-element-interactions': 'off', // 1
'jsx-a11y/click-events-have-key-events': 'off', // 7
'jsx-a11y/no-static-element-interactions': 'off', // 6
'jsx-a11y/control-has-associated-label': 'warn',

// custom-rules
'custom-rules/enforce-path': 'error',
},
overrides: [
{
// overrides for test files
files: [
'*.spec.*',
'*.test.*',
'*.stories.*',
'src/**/test/*',
'src/**/mocks/*',
],
files: ['*.spec.*', '*.test.*', 'scripts/*'],
rules: {
camelcase: 'off',
'@typescript-eslint/no-explicit-any': 'off',
'import/no-extraneous-dependencies': 'off',
'no-console': 'off',

'jsx-a11y/aria-role': 'off',
'jsx-a11y/control-has-associated-label': 'off',
},
},
{
// rules which not make sense for TS files
files: ['*.ts', '*.tsx'],
// overrides for test files
files: ['*.json'],
rules: {
'no-undef': 'off',
bracketSpacing: 2,
},
},
],
Expand Down
75 changes: 20 additions & 55 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,69 +1,18 @@
.env
*.swp
# direnv
.envrc

# C extensions
*.so

# Snyk
.dccache

# Packages
bin/
build/
dist/
downloads/
env/
lib/
lib64/
parts/
sdist/
var/

# Translations
*.mo

# build packages or files that shouldn't be in repo
node_modules
bower_components
.sass-cache
.tmp
app/public/dist
app/public/styles/*.css

# Mr Developer (mac, editor, IDEs, etc)
.mr.developer.cfg
.project
.pydevproject
.vagrant
.ropeproject
.tmp
.sass-cache
.DS_Store
.zedstate
.idea
.cache/
venv/
*.tsbuildinfo
*.log
**.orig

# Frontend
.awcache/
.dist/
npm-debug.log
jest
jest_0
.coverage/
# git
!.vscode/

# yarn related
node_modules
.pnp.*
*.yalc
yalc.lock
**/.yarn/*
yarn-error.log
!**/.yarn/plugins
!**/.yarn/releases
!**/.yarn/sdks
Expand All @@ -72,6 +21,22 @@ yarn-error.log
# We always want them in repository, since they are necessary to install dependencies.
!.yarn/patches

# Certs
# results of tsc build
*.tsbuildinfo

# result of linting
.eslintcache

#coverage
.coverage
.jest-cache

# misc
.DS_Store
.srl
certificate/
yarn-error.log
.dccache

# generated data
certificate
.env
Loading
Loading