diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000000..85b564442a --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,3 @@ +// Root ESLint 9 Flat Config +// This configuration is used for linting the root-level files +module.exports = require('@talend/eslint-config'); diff --git a/fork/module-to-cdn/eslint.config.js b/fork/module-to-cdn/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/fork/module-to-cdn/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/fork/module-to-cdn/package.json b/fork/module-to-cdn/package.json index a7ade1cdf3..96d9e98e70 100644 --- a/fork/module-to-cdn/package.json +++ b/fork/module-to-cdn/package.json @@ -20,7 +20,7 @@ "scripts": { "test": "jest index.test.js", "test:cron": "jest modules.test.js", - "lint": "eslint ./" + "lint": "eslint ." }, "files": [ "index.js", diff --git a/fork/react-bootstrap/eslint.config.js b/fork/react-bootstrap/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/fork/react-bootstrap/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/fork/react-bootstrap/package.json b/fork/react-bootstrap/package.json index 0ba488d493..4f1c1eaa6f 100644 --- a/fork/react-bootstrap/package.json +++ b/fork/react-bootstrap/package.json @@ -19,7 +19,7 @@ "scripts": { "build:lib:esm": "talend-scripts build --esm", "build:lib": "talend-scripts build", - "lint": "talend-scripts lint", + "lint": "eslint .", "test": "talend-scripts test", "storybook": "start-storybook -p 6006", "build-storybook": "build-storybook" diff --git a/packages/a11y/eslint.config.js b/packages/a11y/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/a11y/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/a11y/package.json b/packages/a11y/package.json index 40427ab7d5..25a9361194 100644 --- a/packages/a11y/package.json +++ b/packages/a11y/package.json @@ -16,7 +16,7 @@ "build:lib": "talend-scripts build", "build:lib:esm": "talend-scripts build --esm", "test": "talend-scripts test", - "lint": "talend-scripts lint" + "lint": "eslint ." }, "keywords": [ "react", diff --git a/packages/assets-api/eslint.config.js b/packages/assets-api/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/assets-api/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/assets-api/package.json b/packages/assets-api/package.json index 425159ecb7..dd00f4b6d8 100644 --- a/packages/assets-api/package.json +++ b/packages/assets-api/package.json @@ -18,7 +18,7 @@ "test": "talend-scripts test", "test:watch": "talend-scripts test --watch", "test:cov": "talend-scripts test --coverage", - "lint": "talend-scripts lint" + "lint": "eslint ." }, "keywords": [ "talend" diff --git a/packages/cmf-cqrs/eslint.config.js b/packages/cmf-cqrs/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/cmf-cqrs/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/cmf-cqrs/package.json b/packages/cmf-cqrs/package.json index b9a7bd5964..f47091ff1d 100644 --- a/packages/cmf-cqrs/package.json +++ b/packages/cmf-cqrs/package.json @@ -21,7 +21,7 @@ "test": "talend-scripts test", "test:watch": "talend-scripts test --watch", "test:cov": "talend-scripts test --coverage", - "lint": "talend-scripts lint" + "lint": "eslint ." }, "repository": { "type": "git", diff --git a/packages/cmf-router/eslint.config.js b/packages/cmf-router/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/cmf-router/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/cmf-router/package.json b/packages/cmf-router/package.json index e8ddad71ea..b3fd2b578d 100644 --- a/packages/cmf-router/package.json +++ b/packages/cmf-router/package.json @@ -23,7 +23,7 @@ "test": "talend-scripts test", "test:watch": "talend-scripts test --watch", "test:cov": "talend-scripts test --coverage", - "lint": "talend-scripts lint" + "lint": "eslint ." }, "dependencies": { "@talend/react-cmf": "^12.0.0", diff --git a/packages/cmf/eslint.config.js b/packages/cmf/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/cmf/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/cmf/package.json b/packages/cmf/package.json index 872df5383e..2e53ff2bf5 100644 --- a/packages/cmf/package.json +++ b/packages/cmf/package.json @@ -25,7 +25,7 @@ "test:watch": "talend-scripts test --watch", "test:cov": "talend-scripts test --coverage", "test:demo": "yarn jsdoc -c ./docs.json", - "lint": "talend-scripts lint" + "lint": "eslint ." }, "keywords": [ "react", diff --git a/packages/components/eslint.config.js b/packages/components/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/components/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/components/package.json b/packages/components/package.json index f043b3309d..0211ff687c 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -24,7 +24,7 @@ "test:update": "cross-env TZ=UTC talend-scripts test -u", "test:watch": "cross-env TZ=UTC talend-scripts test --watch", "test:cov": "cross-env TZ=UTC talend-scripts test --coverage", - "lint": "talend-scripts lint", + "lint": "eslint .", "start": "storybook dev", "extract-i18n": "i18next-scanner --config i18next-scanner.config.js" }, diff --git a/packages/containers/eslint.config.js b/packages/containers/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/containers/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/containers/package.json b/packages/containers/package.json index 47d119a445..47d369fcb5 100644 --- a/packages/containers/package.json +++ b/packages/containers/package.json @@ -23,7 +23,7 @@ "test:watch": "talend-scripts test --watch", "test:cov": "talend-scripts test --coverage", "test:demo": "storybook build", - "lint": "talend-scripts lint", + "lint": "eslint .", "extract-i18n": "i18next-scanner --config i18next-scanner.config.js" }, "keywords": [ diff --git a/packages/dataviz/eslint.config.js b/packages/dataviz/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/dataviz/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/dataviz/package.json b/packages/dataviz/package.json index 857005d6f7..df41d3b35c 100644 --- a/packages/dataviz/package.json +++ b/packages/dataviz/package.json @@ -17,7 +17,7 @@ "build:lib:esm": "talend-scripts build --esm", "build-storybook": "storybook build", "extract-i18n": "i18next-scanner --config i18next-scanner.config.js", - "lint": "talend-scripts lint", + "lint": "eslint .", "start": "storybook dev -p 6006", "test": "cross-env TZ=UTC talend-scripts test", "test:watch": "cross-env TZ=UTC talend-scripts test --watch", diff --git a/packages/design-docs/eslint.config.js b/packages/design-docs/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/design-docs/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/design-docs/package.json b/packages/design-docs/package.json index 109f35be8f..aa200d1414 100644 --- a/packages/design-docs/package.json +++ b/packages/design-docs/package.json @@ -7,7 +7,7 @@ "scripts": { "build-storybook": "storybook build --docs", "start-storybook": "storybook dev -p 6006 --docs", - "lint": "talend-scripts lint", + "lint": "eslint .", "start": "storybook dev -p 6006 --docs", "test:demo": "storybook build --docs" }, diff --git a/packages/design-system/eslint.config.js b/packages/design-system/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/design-system/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/design-system/package.json b/packages/design-system/package.json index 8cea1cb017..6e7faee9c0 100644 --- a/packages/design-system/package.json +++ b/packages/design-system/package.json @@ -21,7 +21,7 @@ "watch:esm": "talend-scripts build --watch --esm", "test": "talend-scripts test", "extract-i18n": "i18next-scanner --config i18next-scanner.config.js", - "lint": "talend-scripts lint", + "lint": "eslint .", "start": "storybook dev" }, "repository": { diff --git a/packages/design-tokens/eslint.config.js b/packages/design-tokens/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/design-tokens/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/design-tokens/package.json b/packages/design-tokens/package.json index ad742dc60d..a4f3545fe1 100644 --- a/packages/design-tokens/package.json +++ b/packages/design-tokens/package.json @@ -33,7 +33,7 @@ "build:css": "sass src/index.scss dist/TalendDesignTokens.css --no-source-map --style=compressed", "test": "echo no test for @talend/design-tokens", "test:cov": "echo no test for @talend/design-tokens", - "lint": "talend-scripts lint" + "lint": "eslint ." }, "keywords": [ "talend", diff --git a/packages/faceted-search-query-client/eslint.config.js b/packages/faceted-search-query-client/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/faceted-search-query-client/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/faceted-search-query-client/package.json b/packages/faceted-search-query-client/package.json index c563a80bcc..ced5621967 100644 --- a/packages/faceted-search-query-client/package.json +++ b/packages/faceted-search-query-client/package.json @@ -21,7 +21,7 @@ "test": "cross-env TZ=UTC talend-scripts test", "test:watch": "cross-env TZ=UTC talend-scripts test --watch", "test:cov": "cross-env TZ=UTC talend-scripts test --coverage", - "lint": "talend-scripts lint ./src/**/*.js ./stories/**/*.js ./.storybook/**/*.js", + "lint": "eslint ./src/**/*.js ./stories/**/*.js ./.storybook/**/*.js", "extract-i18n": "i18next-scanner --config i18next-scanner.config.js" }, "keywords": [ diff --git a/packages/faceted-search/eslint.config.js b/packages/faceted-search/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/faceted-search/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/faceted-search/package.json b/packages/faceted-search/package.json index c6eb5ffed9..cd609699d7 100644 --- a/packages/faceted-search/package.json +++ b/packages/faceted-search/package.json @@ -22,7 +22,7 @@ "test:watch": "cross-env TZ=UTC talend-scripts test --watch", "test:cov": "cross-env TZ=UTC talend-scripts test --coverage", "test:demo": "storybook build --docs", - "lint": "talend-scripts lint ./src/**/*.js ./stories/**/*.js ./.storybook/**/*.js", + "lint": "eslint ./src/**/*.js ./stories/**/*.js ./.storybook/**/*.js", "start": "storybook dev -p 6006", "extract-i18n": "i18next-scanner --config i18next-scanner.config.js" }, diff --git a/packages/flow-designer/eslint.config.js b/packages/flow-designer/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/flow-designer/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/flow-designer/package.json b/packages/flow-designer/package.json index 4f87a30db8..26afa59adf 100644 --- a/packages/flow-designer/package.json +++ b/packages/flow-designer/package.json @@ -18,7 +18,7 @@ "scripts": { "build:lib": "talend-scripts build", "build:lib:esm": "talend-scripts build --esm", - "lint": "talend-scripts lint", + "lint": "eslint .", "test": "talend-scripts test" }, "repository": { diff --git a/packages/forms/eslint.config.js b/packages/forms/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/forms/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/forms/package.json b/packages/forms/package.json index 8be8b25005..0994eb1d76 100644 --- a/packages/forms/package.json +++ b/packages/forms/package.json @@ -22,7 +22,7 @@ "test": "cross-env TZ=UTC talend-scripts test", "test:watch": "talend-scripts test --watch", "test:cov": "talend-scripts test --coverage", - "lint": "talend-scripts lint", + "lint": "eslint .", "start": "talend-scripts start-storybook -p 6008", "extract-i18n": "i18next-scanner --config i18next-scanner.config.js" }, diff --git a/packages/http/eslint.config.js b/packages/http/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/http/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/http/package.json b/packages/http/package.json index 80ebc589ea..05a5c52278 100644 --- a/packages/http/package.json +++ b/packages/http/package.json @@ -32,7 +32,7 @@ "build:lib:esm": "talend-scripts build --esm", "start": "echo nothing to start", "test": "talend-scripts test", - "lint": "talend-scripts lint" + "lint": "eslint ." }, "devDependencies": { "@talend/eslint-config": "^14.0.0", diff --git a/packages/local-libs-webpack-plugin/eslint.config.js b/packages/local-libs-webpack-plugin/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/local-libs-webpack-plugin/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/local-libs-webpack-plugin/package.json b/packages/local-libs-webpack-plugin/package.json index c75af72dd9..235f432ec4 100644 --- a/packages/local-libs-webpack-plugin/package.json +++ b/packages/local-libs-webpack-plugin/package.json @@ -6,7 +6,7 @@ "license": "Apache-2.0", "scripts": { "test": "jest", - "lint": "talend-scripts lint lib/**/*.js" + "lint": "eslint lib/**/*.js" }, "keywords": [ "webpack", diff --git a/packages/playground-vite/eslint.config.js b/packages/playground-vite/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/playground-vite/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/playground-vite/package.json b/packages/playground-vite/package.json index 7c1eb1c9ba..aea52f7303 100644 --- a/packages/playground-vite/package.json +++ b/packages/playground-vite/package.json @@ -11,7 +11,7 @@ "test:demo:umd": "cross-env BASENAME='/playground/' INITIATOR_URL='/playground/inject.js' talend-scripts build --prod", "start": "vite dev", "start-dist": "talend-scripts build && node serve-dist", - "lint": "talend-scripts lint" + "lint": "eslint ." }, "repository": { "type": "git", diff --git a/packages/playground/eslint.config.js b/packages/playground/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/playground/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/playground/package.json b/packages/playground/package.json index e1c0d96138..0762d54e19 100644 --- a/packages/playground/package.json +++ b/packages/playground/package.json @@ -9,7 +9,7 @@ "test": "echo nothing to test in playground", "start": "cross-env BASENAME='/' INITIATOR_URL='/inject.js' talend-scripts start --open http://localhost:3000", "start-dist": "talend-scripts build && node serve-dist", - "lint": "talend-scripts lint" + "lint": "eslint ." }, "repository": { "type": "git", diff --git a/packages/router-bridge/eslint.config.js b/packages/router-bridge/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/router-bridge/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/router-bridge/package.json b/packages/router-bridge/package.json index 85cd218e4b..54a4e9540f 100644 --- a/packages/router-bridge/package.json +++ b/packages/router-bridge/package.json @@ -17,7 +17,7 @@ "build:lib": "talend-scripts build", "build:lib:esm": "talend-scripts build --esm", "build": "talend-scripts build", - "lint": "talend-scripts lint", + "lint": "eslint .", "test": "talend-scripts test" }, "repository": { diff --git a/packages/sagas/eslint.config.js b/packages/sagas/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/sagas/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/sagas/package.json b/packages/sagas/package.json index 12bafc5aa9..9a626623e7 100644 --- a/packages/sagas/package.json +++ b/packages/sagas/package.json @@ -21,7 +21,7 @@ "test": "talend-scripts test", "test:watch": "talend-scripts test --watch", "test:cov": "talend-scripts test --coverage", - "lint": "talend-scripts lint" + "lint": "eslint ." }, "keywords": [ "react", diff --git a/packages/stepper/eslint.config.js b/packages/stepper/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/stepper/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/stepper/package.json b/packages/stepper/package.json index a64f467e7b..3f6a82173b 100644 --- a/packages/stepper/package.json +++ b/packages/stepper/package.json @@ -23,7 +23,7 @@ "test:noisy": "cross-env TZ=UTC talend-scripts test", "test:watch": "cross-env TZ=UTC talend-scripts test --watch", "test:cov": "cross-env TZ=UTC talend-scripts test --coverage", - "lint": "talend-scripts lint", + "lint": "eslint .", "start": "talend-scripts start-storybook -p 6006" }, "keywords": [ diff --git a/packages/storybook-cmf/eslint.config.js b/packages/storybook-cmf/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/storybook-cmf/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/storybook-cmf/package.json b/packages/storybook-cmf/package.json index 5f4f82bf8b..242f4ba6ad 100644 --- a/packages/storybook-cmf/package.json +++ b/packages/storybook-cmf/package.json @@ -20,7 +20,7 @@ "build:lib": "talend-scripts build", "build:lib:esm": "talend-scripts build --esm", "test": "talend-scripts test", - "lint": "talend-scripts lint" + "lint": "eslint ." }, "main": "lib/index.js", "mainSrc": "src/index.js", diff --git a/packages/storybook-docs/eslint.config.js b/packages/storybook-docs/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/storybook-docs/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/storybook-docs/package.json b/packages/storybook-docs/package.json index 07bce54f56..418fd8d616 100644 --- a/packages/storybook-docs/package.json +++ b/packages/storybook-docs/package.json @@ -10,7 +10,7 @@ "build:lib": "talend-scripts build && npm run build:styles", "build:lib:esm": "talend-scripts build --esm", "start": "npm run storybook", - "lint": "talend-scripts lint", + "lint": "eslint .", "test": "echo no test", "storybook": "storybook dev -p 6106", "build-storybook": "storybook build --docs" diff --git a/packages/storybook-one/eslint.config.js b/packages/storybook-one/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/storybook-one/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/storybook-one/package.json b/packages/storybook-one/package.json index dc0616f408..86e051ed59 100644 --- a/packages/storybook-one/package.json +++ b/packages/storybook-one/package.json @@ -8,7 +8,7 @@ "test:demo": "storybook build", "build-storybook": "storybook build", "start-storybook": "storybook dev", - "lint": "talend-scripts lint", + "lint": "eslint .", "start": "storybook dev" }, "repository": { diff --git a/packages/theme/eslint.config.js b/packages/theme/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/theme/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/theme/package.json b/packages/theme/package.json index 7c6f281a43..547f3e136b 100644 --- a/packages/theme/package.json +++ b/packages/theme/package.json @@ -9,7 +9,7 @@ "start": "webpack serve --mode=development", "test": "echo no test for @talend/bootstrap-theme", "test:cov": "echo no test for @talend/bootstrap-theme", - "lint": "talend-scripts lint" + "lint": "eslint ." }, "keywords": [ "talend", diff --git a/packages/utils/eslint.config.js b/packages/utils/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/packages/utils/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/packages/utils/package.json b/packages/utils/package.json index 316e971cd8..f24fa6413d 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -24,7 +24,7 @@ "scripts": { "build:lib": "talend-scripts build --tsc", "build:lib:esm": "talend-scripts build --esm", - "lint": "talend-scripts lint", + "lint": "eslint .", "test": "cross-env TZ=UTC talend-scripts test", "test:cov": "cross-env TZ=UTC talend-scripts test --coverage --silent", "test:noisy": "cross-env TZ=UTC talend-scripts test", diff --git a/tools/babel-plugin-assets-api/eslint.config.js b/tools/babel-plugin-assets-api/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/tools/babel-plugin-assets-api/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/tools/babel-plugin-import-d3/eslint.config.js b/tools/babel-plugin-import-d3/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/tools/babel-plugin-import-d3/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/tools/babel-plugin-import-d3/package.json b/tools/babel-plugin-import-d3/package.json index 43876b82f2..d0b1024881 100644 --- a/tools/babel-plugin-import-d3/package.json +++ b/tools/babel-plugin-import-d3/package.json @@ -14,7 +14,7 @@ "url": "https://github.com/Talend/ui.git" }, "scripts": { - "lint": "talend-scripts lint", + "lint": "eslint .", "test": "jest" }, "devDependencies": { diff --git a/tools/babel-plugin-import-from-index/eslint.config.js b/tools/babel-plugin-import-from-index/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/tools/babel-plugin-import-from-index/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/tools/babel-plugin-import-from-lib/eslint.config.js b/tools/babel-plugin-import-from-lib/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/tools/babel-plugin-import-from-lib/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/tools/babel-plugin-import-from-lib/package.json b/tools/babel-plugin-import-from-lib/package.json index 1ec7a3b88c..71f0ab17a5 100644 --- a/tools/babel-plugin-import-from-lib/package.json +++ b/tools/babel-plugin-import-from-lib/package.json @@ -4,7 +4,7 @@ "description": "This plugin transform imports of lib using /lib path", "main": "index.js", "scripts": { - "lint": "talend-scripts lint ./", + "lint": "eslint .", "test": "jest" }, "repository": { diff --git a/tools/cmf-webpack-plugin/eslint.config.js b/tools/cmf-webpack-plugin/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/tools/cmf-webpack-plugin/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/tools/cmf-webpack-plugin/package.json b/tools/cmf-webpack-plugin/package.json index 446fbb75a7..8d37f36a2f 100644 --- a/tools/cmf-webpack-plugin/package.json +++ b/tools/cmf-webpack-plugin/package.json @@ -4,7 +4,7 @@ "main": "src/index.js", "mainSrc": "src/index.js", "scripts": { - "lint": "eslint ./", + "lint": "eslint .", "test": "echo nothing to test yet in @talend/react-cmf-webpack-plugin" }, "repository": { diff --git a/tools/cypress-api-mock-plugin/eslint.config.js b/tools/cypress-api-mock-plugin/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/tools/cypress-api-mock-plugin/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/tools/cypress-api-mock-plugin/package.json b/tools/cypress-api-mock-plugin/package.json index 1d83c43e48..192b39d3da 100644 --- a/tools/cypress-api-mock-plugin/package.json +++ b/tools/cypress-api-mock-plugin/package.json @@ -16,7 +16,7 @@ "api" ], "scripts": { - "lint": "talend-scripts lint ./", + "lint": "eslint .", "test": "echo \"Nothing to test\"" }, "publishConfig": { diff --git a/tools/eslint-plugin/eslint.config.js b/tools/eslint-plugin/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/tools/eslint-plugin/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/tools/eslint-plugin/package.json b/tools/eslint-plugin/package.json index f94f42def0..c105e4a0f1 100644 --- a/tools/eslint-plugin/package.json +++ b/tools/eslint-plugin/package.json @@ -14,7 +14,7 @@ "url": "https://github.com/Talend/ui.git" }, "scripts": { - "lint": "eslint ./", + "lint": "eslint .", "test": "jest" }, "dependencies": { diff --git a/tools/scripts-cmf/eslint.config.js b/tools/scripts-cmf/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/tools/scripts-cmf/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/tools/scripts-cmf/package.json b/tools/scripts-cmf/package.json index 05ff4770ef..8017a912fc 100644 --- a/tools/scripts-cmf/package.json +++ b/tools/scripts-cmf/package.json @@ -10,7 +10,7 @@ "cmf-settings": "./cmf-settings.js" }, "scripts": { - "lint": "eslint ./" + "lint": "eslint ." }, "dependencies": { "commander": "^6.2.1", diff --git a/tools/scripts-config-babel/eslint.config.js b/tools/scripts-config-babel/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/tools/scripts-config-babel/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/tools/scripts-config-babel/package.json b/tools/scripts-config-babel/package.json index c8784a0b12..61e6f856f4 100644 --- a/tools/scripts-config-babel/package.json +++ b/tools/scripts-config-babel/package.json @@ -14,7 +14,7 @@ "url": "https://github.com/Talend/ui.git" }, "scripts": { - "lint": "eslint ./", + "lint": "eslint .", "test": "jest" }, "dependencies": { diff --git a/tools/scripts-config-cdn/eslint.config.js b/tools/scripts-config-cdn/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/tools/scripts-config-cdn/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/tools/scripts-config-cdn/package.json b/tools/scripts-config-cdn/package.json index f451b95352..f75e6100e4 100644 --- a/tools/scripts-config-cdn/package.json +++ b/tools/scripts-config-cdn/package.json @@ -8,7 +8,7 @@ "url": "https://github.com/Talend/ui.git" }, "scripts": { - "lint": "eslint ./", + "lint": "eslint .", "test": "echo \"Nothing to test\"" }, "author": "Talend Frontend (http://www.talend.com)", diff --git a/tools/scripts-config-eslint/README.md b/tools/scripts-config-eslint/README.md index f06a880bfc..73eb2099ae 100644 --- a/tools/scripts-config-eslint/README.md +++ b/tools/scripts-config-eslint/README.md @@ -1,15 +1,104 @@ -# Eslint config customisation +# ESLint Configuration (ESLint 9) -To use the eslint configuration in your IDE, or to add custom rules +This package provides the shared ESLint 9 configuration using the new flat config format for Talend UI projects. -1. Create an `.eslintrc` at your project root folder -2. Make it extend the one from talend preset +## Migration from ESLint 8 + +This package has been migrated to ESLint 9 and uses the new flat config format (`eslint.config.js`). The old `.eslintrc` formats are no longer supported. + +## Usage + +### In Your Project + +1. Create an `eslint.config.js` file at your project root: + +```javascript +module.exports = require('@talend/eslint-config'); +``` + +2. Add a lint script to your `package.json`: ```json { - "extends": "@talend", - "rules": {} + "scripts": { + "lint": "eslint ." + } } ``` -3. Configure your IDE plugin to enable eslint with your root eslintrc configuration. +3. Run linting: + +```bash +npm run lint +# or +yarn lint +``` + +### Customizing Rules + +To add custom rules or override existing ones, you can extend the base config: + +```javascript +const baseConfig = require('@talend/eslint-config'); + +module.exports = [ + ...baseConfig, + { + rules: { + // Your custom rules here + 'no-console': 'warn', + }, + }, +]; +``` + +## Features + +- **ESLint 9** with flat config format +- **TypeScript support** with automatic detection +- **React** and **JSX** support +- **Prettier** integration +- **Import** plugin for managing imports +- Automatic detection of TypeScript projects + +## Configuration Details + +The configuration automatically: + +- Detects if your project uses TypeScript (checks for `tsconfig.json`) +- Applies TypeScript-specific rules when detected +- Configures React settings +- Sets up appropriate globals for browser, Node.js, Jest, and Jasmine + +## IDE Configuration + +### VS Code + +Install the ESLint extension. Modern versions of the VS Code ESLint extension (v3.0.0+) automatically detect and use flat config when available. No additional configuration is needed. + +If you're using an older version of the extension, you may need to update it or add to your `.vscode/settings.json`: + +```json +{ + "eslint.useFlatConfig": true +} +``` + +### Other IDEs + +Ensure your IDE's ESLint plugin is updated to support ESLint 9 and flat config format. + +## Breaking Changes from v13.x + +- Requires ESLint 9.x (was 8.x) +- Uses flat config format instead of `.eslintrc` format +- Removed support for old ESLint 8 configurations +- Updated plugin dependencies to ESLint 9 compatible versions +- `talend-scripts lint` command has been removed - use `eslint .` directly + +## Compatibility + +- Node.js: 18.x or higher +- ESLint: 9.17.0 or higher +- TypeScript: 5.x (optional) + diff --git a/tools/scripts-config-eslint/eslint.config.js b/tools/scripts-config-eslint/eslint.config.js new file mode 100644 index 0000000000..5bb9330c09 --- /dev/null +++ b/tools/scripts-config-eslint/eslint.config.js @@ -0,0 +1,182 @@ +const js = require('@eslint/js'); +const globals = require('globals'); +const babelParser = require('@babel/eslint-parser'); +const tseslint = require('typescript-eslint'); + +const fs = require('fs'); +const path = require('path'); + +function tsConfig() { + const appDirectory = fs.realpathSync(process.cwd()); + const resolveApp = relativePath => path.resolve(appDirectory, relativePath); + return fs.existsSync(resolveApp('tsconfig.json')); +} + +const isTS = tsConfig(); + +// Import plugins using legacy format where needed +const reactPlugin = require('eslint-plugin-react'); +const reactHooksPlugin = require('eslint-plugin-react-hooks'); +const jsxA11yPlugin = require('eslint-plugin-jsx-a11y'); +const importPlugin = require('eslint-plugin-import'); +const prettierPlugin = require('eslint-plugin-prettier'); +const prettierConfig = require('eslint-config-prettier'); +const talendPlugin = require('@talend/eslint-plugin'); + +// Base configuration for all files +const baseConfig = { + languageOptions: { + ecmaVersion: 2022, + sourceType: 'module', + parser: babelParser, + parserOptions: { + requireConfigFile: false, + ecmaFeatures: { + jsx: true, + }, + }, + globals: { + ...globals.browser, + ...globals.es2021, + ...globals.node, + ...globals.jasmine, + ...globals.jest, + jsdom: true, + TALEND_APP_INFO: true, + }, + }, + plugins: { + '@talend': talendPlugin, + react: reactPlugin, + 'react-hooks': reactHooksPlugin, + 'jsx-a11y': jsxA11yPlugin, + import: importPlugin, + prettier: prettierPlugin, + }, + settings: { + react: { + version: 'detect', + }, + }, + rules: { + ...js.configs.recommended.rules, + ...reactPlugin.configs.recommended.rules, + ...reactPlugin.configs['jsx-runtime'].rules, + ...prettierConfig.rules, + '@talend/import-depth': 'error', + '@talend/use-bootstrap-class': 'warn', + 'arrow-parens': ['error', 'as-needed'], + 'comma-dangle': ['error', 'only-multiline'], + 'function-paren-newline': 'off', + 'implicit-arrow-linebreak': 'off', + 'import/prefer-default-export': 'off', + 'import/extensions': 'off', + 'import/no-named-as-default': 'off', + indent: 'off', + 'jsx-a11y/label-has-associated-control': 'error', + 'jsx-a11y/label-has-for': 'off', + 'max-classes-per-file': 'off', + 'new-cap': ['error', { capIsNewExceptions: ['List', 'Map'] }], + 'no-console': ['error', { allow: ['warn', 'error'] }], + 'no-else-return': ['error', { allowElseIf: true }], + 'no-mixed-operators': 'off', + 'no-restricted-globals': 'off', + 'no-restricted-properties': 'off', + 'no-tabs': 'off', + 'object-curly-newline': 'off', + 'operator-linebreak': 'off', + 'prefer-destructuring': 'off', + 'react/button-has-type': 'off', + 'react/destructuring-assignment': 'off', + 'react/forbid-foreign-prop-types': 'off', + 'react/forbid-prop-types': 'off', + 'react-hooks/rules-of-hooks': 'error', + 'react-hooks/exhaustive-deps': 'warn', + 'react/jsx-curly-newline': 'off', + 'react/jsx-filename-extension': ['warn', { extensions: ['.jsx', '.tsx'] }], + 'react/jsx-fragments': 'off', + 'react/jsx-indent': 'off', + 'react/jsx-indent-props': 'off', + 'react/jsx-one-expression-per-line': 'off', + 'react/jsx-props-no-spreading': 'off', + 'react/jsx-wrap-multilines': 'off', + 'react/no-array-index-key': 'off', + 'react/no-this-in-sfc': 'off', + 'react/no-unescaped-entities': 'off', + 'react/no-unused-prop-types': ['error', { skipShapeProps: true }], + 'react/prefer-es6-class': 'off', + 'react/require-default-props': 'off', + 'react/state-in-constructor': 'off', + 'react/static-property-placement': 'off', + }, +}; + +// TypeScript configuration +const tsConfigs = isTS + ? tseslint.config( + ...tseslint.configs.recommended, + { + files: ['**/*.ts', '**/*.tsx'], + languageOptions: { + parser: tseslint.parser, + parserOptions: { + project: true, + tsconfigRootDir: process.cwd(), + }, + }, + rules: { + '@typescript-eslint/indent': 'off', + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/no-explicit-any': 'warn', + }, + }, + { + // Disable TS rules for JS files + files: ['**/*.js'], + rules: { + '@typescript-eslint/no-unsafe-return': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', + '@typescript-eslint/restrict-template-expressions': 'off', + '@typescript-eslint/restrict-plus-operands': 'off', + }, + }, + ) + : []; + +// Test files configuration +const testConfig = { + files: [ + '**/*.test.js', + '**/*.test.ts', + '**/*.test.tsx', + '**/*.stories.js', + '**/*.stories.ts', + '**/*.stories.tsx', + ], + rules: { + 'import/no-extraneous-dependencies': 'off', + }, +}; + +module.exports = [ + { + ignores: [ + '**/node_modules/**', + '**/dist/**', + '**/lib/**', + '**/lib-esm/**', + '**/build/**', + '**/coverage/**', + '**/.storybook/public/**', + './index.js', + './.eslintrc.js', + ], + }, + baseConfig, + ...tsConfigs, + testConfig, +]; + diff --git a/tools/scripts-config-eslint/index.js b/tools/scripts-config-eslint/index.js index abe905bc25..56f8e3e288 100644 --- a/tools/scripts-config-eslint/index.js +++ b/tools/scripts-config-eslint/index.js @@ -1,62 +1,3 @@ -const fs = require('fs'); -const path = require('path'); - -function tsConfig() { - const appDirectory = fs.realpathSync(process.cwd()); - const resolveApp = relativePath => path.resolve(appDirectory, relativePath); - - return fs.existsSync(resolveApp('tsconfig.json')); -} - -const cwd = process.cwd(); -const isTS = tsConfig(); -const commentsRegex = /\/\/.*/g; -const content = fs - .readFileSync(path.join(__dirname, '.eslintrc.json')) - .toString() - .replace(commentsRegex, ''); -const config = JSON.parse(content); - -if (isTS) { - delete config.parserOptions; - const TO_REMOVE = ['airbnb-base', 'plugin:import/recommended']; - Object.assign(config, { - parser: '@typescript-eslint/parser', - extends: config.extends - .concat([ - 'airbnb-typescript', - 'plugin:import/typescript', - 'plugin:@typescript-eslint/recommended', - ]) - .filter(i => !TO_REMOVE.includes(i)), - plugins: config.plugins.concat(['@typescript-eslint']), - parserOptions: { - project: true, - tsconfigRootDir: cwd, - }, - rules: { - ...config.rules, - '@typescript-eslint/indent': 0, - '@typescript-eslint/no-var-requires': 0, // we have a lot of CJS files to lint, - '@typescript-eslint/no-explicit-any': 1, - }, - overrides: [ - ...(config.overrides || []), - { - // Disable TS rules for JS files if project uses plugin:@typescript-eslint/recommended-requiring-type-checking - files: ['*.js'], - rules: { - '@typescript-eslint/no-unsafe-return': 'off', - '@typescript-eslint/no-unsafe-call': 'off', - '@typescript-eslint/no-unsafe-member-access': 'off', - '@typescript-eslint/no-unsafe-assignment': 'off', - '@typescript-eslint/no-unsafe-argument': 'off', - '@typescript-eslint/restrict-template-expressions': 'off', - '@typescript-eslint/restrict-plus-operands': 'off', - }, - }, - ], - }); -} - -module.exports = config; +// ESLint 9 Flat Config +// This module exports a flat config factory for use with ESLint 9 +module.exports = require('./eslint.config.js'); diff --git a/tools/scripts-config-eslint/package.json b/tools/scripts-config-eslint/package.json index 14500c8b28..9c233f8b2f 100644 --- a/tools/scripts-config-eslint/package.json +++ b/tools/scripts-config-eslint/package.json @@ -14,7 +14,7 @@ "url": "https://github.com/Talend/ui.git" }, "scripts": { - "lint": "eslint index.js __tests__", + "lint": "eslint .", "test": "jest" }, "devDependencies": { @@ -22,24 +22,19 @@ }, "dependencies": { "@babel/eslint-parser": "^7.28.6", + "@eslint/js": "^9.17.0", "@talend/eslint-plugin": "^1.7.0", - "@testing-library/dom": "^9.3.4", - "@typescript-eslint/parser": "^6.21.0", - "@typescript-eslint/eslint-plugin": "^6.21.0", - "eslint": "^8.57.1", - "eslint-config-airbnb-base": "^15.0.0", - "eslint-config-airbnb-typescript": "^17.1.0", + "@typescript-eslint/parser": "^8.19.1", + "@typescript-eslint/eslint-plugin": "^8.19.1", + "eslint": "^9.39.2", "eslint-config-prettier": "^9.1.2", - "eslint-plugin-angular": "^4.1.0", "eslint-plugin-import": "^2.32.0", - "eslint-plugin-jest-dom": "^5.5.0", "eslint-plugin-jsx-a11y": "^6.10.2", - "eslint-plugin-mdx": "^2.3.4", "eslint-plugin-prettier": "^5.5.5", "eslint-plugin-react": "^7.37.5", - "eslint-plugin-react-hooks": "^4.6.2", - "eslint-plugin-storybook": "^0.6.15", - "eslint-plugin-testing-library": "^6.5.0" + "eslint-plugin-react-hooks": "^5.1.0", + "globals": "^15.14.0", + "typescript-eslint": "^8.19.1" }, "publishConfig": { "access": "public" diff --git a/tools/scripts-config-jest/eslint.config.js b/tools/scripts-config-jest/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/tools/scripts-config-jest/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/tools/scripts-config-jest/package.json b/tools/scripts-config-jest/package.json index 0876fb4699..d869231236 100644 --- a/tools/scripts-config-jest/package.json +++ b/tools/scripts-config-jest/package.json @@ -14,7 +14,7 @@ "url": "https://github.com/Talend/ui.git" }, "scripts": { - "lint": "eslint ./", + "lint": "eslint .", "test": "jest" }, "dependencies": { diff --git a/tools/scripts-config-prettier/eslint.config.js b/tools/scripts-config-prettier/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/tools/scripts-config-prettier/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/tools/scripts-config-prettier/package.json b/tools/scripts-config-prettier/package.json index e98f4a0ed2..19025a589a 100644 --- a/tools/scripts-config-prettier/package.json +++ b/tools/scripts-config-prettier/package.json @@ -12,7 +12,7 @@ "url": "https://github.com/Talend/ui.git" }, "scripts": { - "lint": "eslint ./", + "lint": "eslint .", "test": "echo \"Nothing to test\"" }, "license": "Apache-2.0", diff --git a/tools/scripts-config-react-webpack/eslint.config.js b/tools/scripts-config-react-webpack/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/tools/scripts-config-react-webpack/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/tools/scripts-config-react-webpack/package.json b/tools/scripts-config-react-webpack/package.json index 3fc2ee7cc7..9f2b976b01 100644 --- a/tools/scripts-config-react-webpack/package.json +++ b/tools/scripts-config-react-webpack/package.json @@ -14,7 +14,7 @@ "url": "https://github.com/Talend/ui.git" }, "scripts": { - "lint": "eslint ./", + "lint": "eslint .", "test": "echo \"Nothing to test\"" }, "peerDependencies": { diff --git a/tools/scripts-config-storybook-lib/eslint.config.js b/tools/scripts-config-storybook-lib/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/tools/scripts-config-storybook-lib/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/tools/scripts-config-storybook-lib/package.json b/tools/scripts-config-storybook-lib/package.json index 440172ab87..770ba62f64 100644 --- a/tools/scripts-config-storybook-lib/package.json +++ b/tools/scripts-config-storybook-lib/package.json @@ -28,7 +28,7 @@ "scripts": { "build:lib": "tsc", "build:watch": "tsc --watch", - "lint": "talend-scripts lint", + "lint": "eslint .", "update:msw": "npx msw init public/msw --save" }, "files": [ diff --git a/tools/scripts-config-stylelint/eslint.config.js b/tools/scripts-config-stylelint/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/tools/scripts-config-stylelint/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/tools/scripts-config-stylelint/package.json b/tools/scripts-config-stylelint/package.json index bf433530c1..8bbdf6f37e 100644 --- a/tools/scripts-config-stylelint/package.json +++ b/tools/scripts-config-stylelint/package.json @@ -10,7 +10,7 @@ "url": "https://github.com/Talend/ui/issues" }, "scripts": { - "lint": "eslint ./", + "lint": "eslint .", "test": "echo \"Nothing to test\"" }, "repository": { diff --git a/tools/scripts-config-typescript/eslint.config.js b/tools/scripts-config-typescript/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/tools/scripts-config-typescript/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/tools/scripts-config-typescript/package.json b/tools/scripts-config-typescript/package.json index b4e2c24174..93ec896075 100644 --- a/tools/scripts-config-typescript/package.json +++ b/tools/scripts-config-typescript/package.json @@ -10,7 +10,7 @@ "url": "https://github.com/Talend/ui/issues" }, "scripts": { - "lint": "eslint ./", + "lint": "eslint .", "test": "echo \"Nothing to test\"" }, "repository": { diff --git a/tools/scripts-core/eslint.config.js b/tools/scripts-core/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/tools/scripts-core/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/tools/scripts-core/package.json b/tools/scripts-core/package.json index e3cb705b67..97b9be77fe 100644 --- a/tools/scripts-core/package.json +++ b/tools/scripts-core/package.json @@ -18,7 +18,7 @@ "url": "https://github.com/Talend/ui.git" }, "scripts": { - "lint": "node ./src/index.js lint", + "lint": "eslint .", "test": "node ./src/index.js test ./__tests__" }, "peerDependencies": { diff --git a/tools/scripts-core/src/index.js b/tools/scripts-core/src/index.js index 4b0e29d77f..9e99a70732 100755 --- a/tools/scripts-core/src/index.js +++ b/tools/scripts-core/src/index.js @@ -13,7 +13,6 @@ if (command === '--help' || command === '-h' || command === 'help') { console.log(`Please use one of the following commands: * start * build -* lint * lint-merge-report * test * extends @@ -78,7 +77,6 @@ async function runScript() { switch (command) { case 'build': - case 'lint': case 'start': case 'test': runScript(command, options); @@ -86,35 +84,39 @@ switch (command) { case 'lint-merge-report': mergeReport(options); break; + case 'lint': + console.log('The "lint" command has been removed. Please use "eslint ." directly with @talend/eslint-config'); + process.exit(1); + break; case 'build:lib': case 'build:lib:umd': console.log('This command do not exists anymore, please use just "build" command'); - process.exit(-1); + process.exit(1); break; case 'lint:es': case 'lint:style': console.log('This command do not exists anymore, please use just "lint" command'); - process.exit(-1); + process.exit(1); break; case 'test:ng': console.log('This command do not exists anymore, please use just "test" command'); - process.exit(-1); + process.exit(1); break; case 'upgrade:deps': console.log( 'This command do not exists anymore, please use just "talend-upgrade-deps" binary from "@talend/upgrade-deps" package', ); - process.exit(-1); + process.exit(1); break; case 'publish:local': console.log( 'This command do not exists anymore, please use just "talend-publish-local" bin from "@talend/scripts-publish-local" package', ); - process.exit(-1); + process.exit(1); break; default: console.log(`Command ${command} not found.`); - process.exit(-1); + process.exit(1); } /* eslint-disable global-require,no-console */ diff --git a/tools/scripts-locales/eslint.config.js b/tools/scripts-locales/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/tools/scripts-locales/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/tools/scripts-locales/package.json b/tools/scripts-locales/package.json index c7349ce6d0..af88fddba6 100644 --- a/tools/scripts-locales/package.json +++ b/tools/scripts-locales/package.json @@ -11,7 +11,7 @@ "url": "https://github.com/Talend/ui.git" }, "scripts": { - "lint": "talend-scripts lint" + "lint": "eslint ." }, "dependencies": { "@talend/scripts-utils": "^2.7.0", diff --git a/tools/scripts-publish-local/eslint.config.js b/tools/scripts-publish-local/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/tools/scripts-publish-local/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/tools/scripts-publish-local/package.json b/tools/scripts-publish-local/package.json index 159b8b85e8..b67fa1abcb 100644 --- a/tools/scripts-publish-local/package.json +++ b/tools/scripts-publish-local/package.json @@ -11,7 +11,7 @@ }, "main": "src/index.js", "scripts": { - "lint": "talend-scripts lint ./", + "lint": "eslint .", "test": "echo nothing to test" }, "dependencies": { diff --git a/tools/scripts-utils/eslint.config.js b/tools/scripts-utils/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/tools/scripts-utils/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/tools/scripts-utils/package.json b/tools/scripts-utils/package.json index 197ae4fd78..5e926eaa8f 100644 --- a/tools/scripts-utils/package.json +++ b/tools/scripts-utils/package.json @@ -4,7 +4,7 @@ "description": "", "main": "src/index.js", "scripts": { - "lint": "eslint ./", + "lint": "eslint .", "test": "jest .test.js" }, "dependencies": { diff --git a/tools/scripts-yarn-workspace/eslint.config.js b/tools/scripts-yarn-workspace/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/tools/scripts-yarn-workspace/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/tools/scripts-yarn-workspace/package.json b/tools/scripts-yarn-workspace/package.json index 46b3ee1c9f..1c7668ecd2 100644 --- a/tools/scripts-yarn-workspace/package.json +++ b/tools/scripts-yarn-workspace/package.json @@ -7,7 +7,7 @@ "talend-yarn-workspace": "./src/index.js" }, "scripts": { - "lint": "talend-scripts lint" + "lint": "eslint ." }, "author": "frontend@talend.com", "devDependencies": { diff --git a/tools/upgrade-deps/eslint.config.js b/tools/upgrade-deps/eslint.config.js new file mode 100644 index 0000000000..02a799084a --- /dev/null +++ b/tools/upgrade-deps/eslint.config.js @@ -0,0 +1 @@ +module.exports = require('@talend/eslint-config'); diff --git a/tools/upgrade-deps/package.json b/tools/upgrade-deps/package.json index f26f14a54b..dc600cbcec 100644 --- a/tools/upgrade-deps/package.json +++ b/tools/upgrade-deps/package.json @@ -28,7 +28,7 @@ "url": "https://github.com/Talend/ui.git" }, "scripts": { - "lint": "talend-scripts lint ./", + "lint": "eslint .", "test:cron": "talend-scripts test" }, "publishConfig": {