Skip to content

Commit

Permalink
refactor: remove husky (#2397)
Browse files Browse the repository at this point in the history
* refactor/remove husky

* Move lint-staged stuff into pre-commit

* Moved eslintignore and tsconfig

* refactor/remove husky

* refactor/remove husky

* ignore frontend prettier - handled by eslint

* refactor/remove husky

* refactor/remove husky

* refactor/remove husky

* removed

* refactor/remove husky

* refactor/remove husky
  • Loading branch information
dabeeeenster authored Jul 14, 2023
1 parent a31fe3c commit e48c44d
Show file tree
Hide file tree
Showing 13 changed files with 130 additions and 60 deletions.
10 changes: 10 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.idea
frontend/node_modules
frontend/reports
frontend/public
frontend/tests_output
frontend/web/static
frontend/web/project/libs.js
frontend/e2e
frontend/webpack
frontend/api
15 changes: 10 additions & 5 deletions frontend/.eslintrc.js → .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module.exports = {
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'plugin:@dword-design/import-alias/recommended',
],
'globals': {
Expand All @@ -29,6 +28,7 @@ module.exports = {
'CodeHelp': true,
'Column': true,
'Cookies': true,
'DYNATRACE_URL': true,
'Dispatcher': true,
'DYNATRACE_URL': true,
'dtrum': true,
Expand Down Expand Up @@ -79,6 +79,7 @@ module.exports = {
'closeModal2': true,
'delighted': true,
'describe': true,
'dtrum': true,
'em': true,
'flagsmith': true,
'ga': true,
Expand All @@ -101,7 +102,11 @@ module.exports = {
'window': true,
'zE': true,
},
'ignorePatterns': ['server/index.js', 'next.config.js', 'babel.config.js'],
'ignorePatterns': [
'frontend/server/index.js',
'frontend/next.config.js',
'frontend/babel.config.js',
],
'parser': '@typescript-eslint/parser',
'parserOptions': {
'ecmaFeatures': {
Expand All @@ -123,9 +128,9 @@ module.exports = {
'error',
{
'alias': {
'common': './common/',
'components': './web/components/',
'project': './web/project/',
'common': './frontend/common/',
'components': './frontend/web/components/',
'project': './frontend/web/project/',
},
},
],
Expand Down
9 changes: 9 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[flake8]
max-line-length = 120
max-complexity = 10
exclude = .git,.venv,.direnv,__pycache__,*/migrations/*

per-file-ignores =
api/app/settings/local.py: F403, F405
api/app/settings/production.py: F403, F405
api/app/settings/saas.py: F403, F405
33 changes: 33 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,36 @@ repos:
rev: v3.0.0
hooks:
- id: prettier
- repo: https://github.com/pre-commit/mirrors-eslint
rev: 'v8.44.0'
hooks:
- id: eslint
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx]
types: [file]
args: [--fix]
exclude: |
(?x)(
.idea|
^frontend/node_modules/|
^frontend/reports/|
^frontend/public/|
^frontend/tests_output/|
^frontend/web/static/|
^frontend/web/project/libs.js/|
^frontend/e2e/|
^frontend/webpack/|
^frontend/api/
)$
additional_dependencies:
- eslint@8.44.0
- eslint-plugin-react@7.32.2
- eslint-plugin-react-hooks@4.6.0
- eslint-plugin-sort-keys-fix@1.1.2
- '@typescript-eslint/eslint-plugin@6.0.0'
- eslint-config-prettier@8.8.0
- eslint-plugin-prettier@5.0.0
- '@dword-design/eslint-plugin-import-alias@4.0.8'
- '@typescript-eslint/parser@6.0.0'
- eslint-plugin-import@2.27.5
- eslint-plugin-sort-destructure-keys@1.4.0
- eslint-plugin-sort-keys-fix@1.1.2
11 changes: 10 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,13 @@
*.json
*.handlebars
*.css
.bablerc
.bablerc
frontend/node_modules
frontend/report
frontend/public
frontend/tests_output
frontend/web/static
frontend/web/project/libs.js
frontend/e2e
frontend/webpack
frontend/api
19 changes: 19 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,25 @@
"options": {
"tabWidth": 2
}
},
{
"files": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"],
"options": {
"arrowParens": "always",
"bracketSpacing": true,
"insertPragma": false,
"jsxSingleQuote": true,
"printWidth": 80,
"proseWrap": "preserve",
"quoteProps": "preserve",
"requirePragma": false,
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false,
"vueIndentScriptAndStyle": false
}
}
]
}
11 changes: 0 additions & 11 deletions frontend/.eslintignore

This file was deleted.

1 change: 0 additions & 1 deletion frontend/.husky/_/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions frontend/.husky/pre-commit

This file was deleted.

16 changes: 0 additions & 16 deletions frontend/.prettierrc

This file was deleted.

20 changes: 0 additions & 20 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"kill": "kill -9 $(lsof -ti tcp:4444)",
"test:bundle": "cross-env E2E=1 npm run bundle",
"postinstall": "npm run env",
"husky:install": "cd ../ && husky install ./frontend/husky && cd ./frontend",
"test:bundle:staging": "cross-env E2E=1 ENV=staging npm run bundle",
"test:dev": "cross-env NODE_ENV=production E2E=true E2E_DEV=true node ./e2e/index.cafe",
"test:devBundle": "npm run test:bundle && npm run test:dev",
Expand Down Expand Up @@ -74,7 +73,6 @@
"html-loader": "1.3.2",
"html-webpack-plugin": "5.5.0",
"http-proxy-middleware": "^1.0.6",
"husky": "^8.0.2",
"ionicons": "4.0.0",
"js-cookie": "2.2.1",
"json-loader": "0.5.4",
Expand Down
39 changes: 39 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"compilerOptions": {
"strict": true,
"baseUrl": ".",
"esModuleInterop": true,
"downlevelIteration": true,
"noEmit": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"allowJs": true,
"lib": [
"dom"
],
"jsx": "preserve",
"incremental": true,
"skipLibCheck": true,
"paths": {
"common/*": [
"./frontend/common/*"
],
"components/*": [
"./frontend/web/components/*"
],
"project/*": [
"./frontend/web/project/*"
]
}
},
"exclude": [
"node_modules",
],
"include": [
"global.d.ts",
"**/*.ts",
"**/*.tsx"
]
}

3 comments on commit e48c44d

@vercel
Copy link

@vercel vercel bot commented on e48c44d Jul 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on e48c44d Jul 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./docs

docs.bullet-train.io
docs-git-main-flagsmith.vercel.app
docs.flagsmith.com
docs-flagsmith.vercel.app

@vercel
Copy link

@vercel vercel bot commented on e48c44d Jul 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.