From a02b477f47480bb789a42b572f4b1ad763e856d4 Mon Sep 17 00:00:00 2001 From: Txabi Lopez Date: Tue, 23 Apr 2024 09:45:42 +0100 Subject: [PATCH] chore: remove flow rules after agreed this with Carlos Serrano, remove support for flow. We don't use it and it brings some unneeded complexity to the package. BREAKING CHANGE: remove support for Flow Issues: MOL-29362 --- README.md | 58 ++++++++++++++++------------------ configurations/flowtype.json | 61 ------------------------------------ flowtype.js | 1 - package.json | 1 - 4 files changed, 27 insertions(+), 94 deletions(-) delete mode 100644 configurations/flowtype.json delete mode 100644 flowtype.js diff --git a/README.md b/README.md index d5ca65f..39953f0 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,16 @@ Add `eslint-config-mailonline` as a development dependency: npm install eslint-config-mailonline --save-dev ``` -Create ESLint configuration file (`.eslintrc`) that extends `eslint-config-mailonline`: +Create ESLint configuration file (`eslint.config.js`) that extends `eslint-config-mailonline`: -```json -{ - "extends": "mailonline" -} +```js +// eslint.config.[m]js +import baseMailonlineConfig from "eslint-config-mailonline"; + +export default [{ + ...baseMailonlineConfig, + // additional config here +]; ``` ## Extended configs @@ -25,62 +29,54 @@ Create ESLint configuration file (`.eslintrc`) that extends `eslint-config-mailo The package also has separate entry points for some environments. Simply extend from the entry point as described below, either in a folder-specific eslint config, or additionally to the root config, e.g.: -```json -{ +```js +module.exports = { "extends": [ "mailonline", "mailonline/jest", "mailonline/react" ] -} +}; ``` ### jest -```json -{ +```js +module.exports = { "extends": "mailonline/jest" -} +}; ``` ### mocha -```json -{ +```js +module.exports = { "extends": "mailonline/mocha" -} +}; ``` ### react -```json -{ +```js +module.exports = { "extends": "mailonline/react" -} -``` - -### flowtype - -```json -{ - "extends": "mailonline/flowtype" -} +}; ``` ### lodash -```json -{ +```js +module.exports = { "extends": "mailonline/lodash" -} +}; ``` ### webpack -```json -{ +```js +module.exports = { "extends": "mailonline/webpack" -} +}; ``` ## Breaking changes diff --git a/configurations/flowtype.json b/configurations/flowtype.json deleted file mode 100644 index 7c0a344..0000000 --- a/configurations/flowtype.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "plugins": [ - "flowtype" - ], - "rules": { - "flowtype/boolean-style": [ - 2, - "boolean" - ], - "flowtype/define-flow-type": 1, - "flowtype/delimiter-dangle": [ - 2, - "never" - ], - "flowtype/generic-spacing": [ - 2, - "never" - ], - "flowtype/no-primitive-constructor-types": 2, - "flowtype/no-types-missing-file-annotation": 2, - "flowtype/no-weak-types": 2, - "flowtype/object-type-delimiter": [ - 2, - "comma" - ], - "flowtype/require-parameter-type": 0, - "flowtype/require-return-type": 0, - "flowtype/require-valid-file-annotation": 2, - "flowtype/require-variable-type": 0, - "flowtype/semi": [ - 2, - "always" - ], - "flowtype/space-after-type-colon": [ - 2, - "always" - ], - "flowtype/space-before-generic-bracket": [ - 2, - "never" - ], - "flowtype/space-before-type-colon": [ - 2, - "never" - ], - "flowtype/type-id-match": [ - 2, - "^([A-Z][a-z0-9]+)+Type$" - ], - "flowtype/union-intersection-spacing": [ - 2, - "always" - ], - "flowtype/use-flow-type": 1 - }, - "settings": { - "flowtype": { - "onlyFilesWithFlowAnnotation": true - } - } -} diff --git a/flowtype.js b/flowtype.js deleted file mode 100644 index 3080b80..0000000 --- a/flowtype.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./configurations/flowtype.json'); diff --git a/package.json b/package.json index 04baa61..90eab6b 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "babel-eslint": "^10.1.0", "eslint-plugin-babel": "^5.3.1", "eslint-plugin-filenames": "^1.3.2", - "eslint-plugin-flowtype": "^8.0.3", "eslint-plugin-import": "^2.29.1", "eslint-plugin-jest": "^28.2.0", "eslint-plugin-jsdoc": "^48.2.3",