From 9418f607c0fb3be7a0e3694c4d1e3e34c9683b69 Mon Sep 17 00:00:00 2001 From: Mihir Samdarshi Date: Thu, 2 May 2024 22:28:30 -0700 Subject: [PATCH] fix: update linting configurations --- .dockerignore | 4 +++- .eslintrc.cjs | 29 ----------------------------- .prettierrc.cjs | 4 ---- .prettierrc.js | 4 ++++ README.md | 4 ++-- eslint.config.cjs | 17 +++++++++++++++++ package.json | 9 +++++---- stylelint.config.js | 2 +- 8 files changed, 32 insertions(+), 41 deletions(-) delete mode 100644 .eslintrc.cjs delete mode 100644 .prettierrc.cjs create mode 100644 .prettierrc.js create mode 100644 eslint.config.cjs diff --git a/.dockerignore b/.dockerignore index d0bb6faa..71d752ee 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,11 +2,13 @@ node_modules/ README.md LICENSE .prettierignore -.eslintrc.js +eslint.config.cjs .prettierrc.js +stylelint.config.js .circleci/ .github/ scripts/ .storybook/ .env build/ +/.yarn/ diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index bb36d9e7..00000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,29 +0,0 @@ -module.exports = { - extends: ['airbnb'], - plugins: ['react-hooks'], - rules: { - 'jsx-a11y/label-has-for': 0, - 'jsx-a11y/label-has-associated-control': 0, - 'jsx-a11y/control-has-associated-label': 0, - 'jsx-a11y/no-noninteractive-tabindex': 0, - 'react-hooks/rules-of-hooks': 'error', - 'react-hooks/exhaustive-deps': 'warn', - 'import/no-extraneous-dependencies': ['error', { devDependencies: true }], - 'no-console': 0, - 'no-param-reassign': 0, - 'no-use-before-define': 0, - 'func-names': 0, - 'consistent-return': 0, - 'prefer-template': 0, - 'react/jsx-props-no-spreading': 0, - 'react/prop-types': 0, - 'react/forbid-prop-types': 0, - 'react/no-unescaped-entities': 0, - 'react/jsx-filename-extension': 0, - 'react/no-this-in-sfc': 0, - }, - env: { - browser: true, - jest: true, - }, -}; diff --git a/.prettierrc.cjs b/.prettierrc.cjs deleted file mode 100644 index 46da46df..00000000 --- a/.prettierrc.cjs +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - arrowParens: "always", - singleQuote: true, -}; diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 00000000..87020307 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,4 @@ +export default { + arrowParens: 'always', + singleQuote: true, +}; diff --git a/README.md b/README.md index 5c70ba06..a00f544a 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,8 @@ │   | └── \_\_test\_\_: contains the storybook story and jest tests for the feature. ├── public ├── .storybook: configuration for storybook -├── .eslintrc.cjs: ESlint configuration -├── .prettierrc.cjs: Prettier configuration +├── .eslintrc: ESlint configuration +├── .prettierrc.js: Prettier configuration ├── .stylelint.config.js: StyleLint configurations for Sass Linting #### Flow for creating new components diff --git a/eslint.config.cjs b/eslint.config.cjs new file mode 100644 index 00000000..12889a17 --- /dev/null +++ b/eslint.config.cjs @@ -0,0 +1,17 @@ +const react = require('eslint-plugin-react'); + +module.exports = [ + { + files: ['**/*.{js,jsx,mjs,cjs,ts,tsx}'], + plugins: { + react, + }, + languageOptions: { + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + }, + }, +]; \ No newline at end of file diff --git a/package.json b/package.json index 2b550147..ee3cc6b9 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "history": "4.10.1", "http-proxy-middleware": "^2.0.1", "jquery": "^3.5.1", - "lodash": "^4.17.11", + "lodash": "^4.17.21", "popper.js": "^1.16.1", "prop-types": "15.8.1", "react": "17.0.1", @@ -66,12 +66,13 @@ "@vitest/coverage-v8": "^1.4.0", "@wojtekmaj/enzyme-adapter-react-17": "0.8.0", "enzyme": "3.11.0", + "eslint": "^9.1.1", "eslint-config-airbnb": "^19.0.4", - "eslint-plugin-react-hooks": "^4.6.0", + "eslint-plugin-react": "^7.34.1", "jest-canvas-mock": "^2.2.0", - "postcss-normalize": "^10.0.1", "jsdom": "^24.0.0", - "prettier": "^3.0.0", + "postcss-normalize": "^10.0.1", + "prettier": "^3.2.5", "react-error-overlay": "^6.0.11", "sass": "1.70.0", "storybook": "^8.0.9", diff --git a/stylelint.config.js b/stylelint.config.js index f73cf2e5..d70b6681 100644 --- a/stylelint.config.js +++ b/stylelint.config.js @@ -1,3 +1,3 @@ -module.exports = { +export default { extends: 'stylelint-config-recommended', };