Skip to content

Commit

Permalink
Fix linting errors across the app (ToolJet#785)
Browse files Browse the repository at this point in the history
* eslint-setup: rules for frontend and server

* setup pre-commit:hook

* frontend:eslint fixes

* frontend eslint errors and warning fixed

* eslint:fix for ./server

* fix server/test: expectatin string lint/error

* pre-commit:updated

* removed unwanted install cmd from docker file

* recommended settings and extension for vscode

* husky prepare script added

* updated extension recommendations

* added prettier as recommended extension

* added pre-commit to package.json

* remove .prettierrc file

* resolve changes

* resolve changes
  • Loading branch information
arpitnath authored Sep 21, 2021
1 parent 4000514 commit 26c9cc6
Show file tree
Hide file tree
Showing 263 changed files with 7,833 additions and 5,409 deletions.
2 changes: 0 additions & 2 deletions .prettierignore

This file was deleted.

8 changes: 0 additions & 8 deletions .prettierrc

This file was deleted.

11 changes: 11 additions & 0 deletions .vscode/extension.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"CoenraadS.bracket-pair-colorizer",
"mgmcdermott.vscode-language-babel",
"formulahendry.auto-rename-tag",
"xabikos.javascriptsnippets",
"streetsidesoftware.code-spell-checker",
"esbenp.prettier-vscode"
]
}
14 changes: 14 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"[javascript, typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
},
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"eslint.format.enable": true,
"editor.formatOnSave": true,

}
1 change: 1 addition & 0 deletions docker/client.Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ENV PATH /app/node_modules/.bin:$PATH
# Fix for heap limit allocation issue
ENV NODE_OPTIONS="--max-old-space-size=2048"


# install app dependencies
COPY package.json package-lock.json ./
RUN npm install
Expand Down
37 changes: 0 additions & 37 deletions frontend/.eslintrc.js

This file was deleted.

56 changes: 56 additions & 0 deletions frontend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"env": {
"browser": true,
"amd": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:prettier/recommended",
"plugin:cypress/recommended"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": ["react", "prettier"],
"rules": {
"prettier/prettier": [
"error",
{
"semi": true,
"trailingComma": "es5",
"printWidth": 120,
"singleQuote": true,
"arrowParens": "always",
"proseWrap": "preserve"
}
],
"react/prop-types": 0,
"react/display-name": "off",
"no-unused-vars": [2, { "args": "after-used", "argsIgnorePattern": "reject" }],
"react/no-deprecated": 0,
"no-prototype-builtins": 0
},
"settings": {
"react": {
"version": "detect"
},
"import/resolver": "webpack"
},
"globals": {
"fetch": true,
"process": true,
"module": true,
"__dirname": true
}
}

14 changes: 5 additions & 9 deletions frontend/cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
const webpackPreprocessor = require('@cypress/webpack-preprocessor')

module.exports = (on, config) => {
if (config.testingType === 'component') {
const { startDevServer } = require('@cypress/webpack-dev-server')
const { startDevServer } = require('@cypress/webpack-dev-server');

// Your project's Webpack configuration
const webpackConfig = require('../../webpack.config.js')
const webpackConfig = require('../../webpack.config.js');

on('dev-server:start', (options) =>
startDevServer({ options, webpackConfig })
)
on('dev-server:start', (options) => startDevServer({ options, webpackConfig }));
}

return config
}
return config;
};
2 changes: 1 addition & 1 deletion frontend/cypress/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'
import './commands';

// Alternatively you can use CommonJS syntax:
// require('./commands')
Loading

0 comments on commit 26c9cc6

Please sign in to comment.