From 5032e0c67792838d6754d172301e2373cf68deb7 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Tue, 5 Oct 2021 21:27:30 +0200 Subject: ci(web): add eslint and stylelint to sonar --- language-web/.eslintrc.ci.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 language-web/.eslintrc.ci.js (limited to 'language-web/.eslintrc.ci.js') diff --git a/language-web/.eslintrc.ci.js b/language-web/.eslintrc.ci.js new file mode 100644 index 00000000..b4c83bb8 --- /dev/null +++ b/language-web/.eslintrc.ci.js @@ -0,0 +1,33 @@ +// Loosely based on +// https://github.com/iamturns/create-exposed-app/blob/f14e435b8ce179c89cce3eea89e56202153a53da/.eslintrc.js +module.exports = { + plugins: [ + '@typescript-eslint', + ], + extends: [ + 'airbnb', + 'airbnb-typescript', + 'airbnb/hooks', + 'plugin:@typescript-eslint/recommended', + 'plugin:@typescript-eslint/recommended-requiring-type-checking', + ], + parserOptions: { + project: './tsconfig.json', + }, + rules: { + // https://basarat.gitbooks.io/typescript/docs/tips/defaultIsBad.html + 'import/prefer-default-export': 'off', + 'import/no-default-export': 'error', + // propTypes are for runtime validation, but we rely on TypeScript for build-time validation: + // https://github.com/yannickcr/eslint-plugin-react/issues/2275#issuecomment-492003857 + 'react/prop-types': 'off', + // Make sure switches are exhaustive: https://stackoverflow.com/a/60166264 + 'default-case': 'off', + '@typescript-eslint/switch-exhaustiveness-check': 'error', + }, + ignorePatterns: [ + '*.js', + 'build/**/*', + 'src/main/js/xtext/**/*', + ], +}; -- cgit v1.2.3-54-g00ecf