From 017166ab66a583f8d214009fbb422b8652bd1256 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Sat, 11 Jan 2025 12:56:35 +0300 Subject: [PATCH] feat: add typescript config --- configs/react-typescript.js | 2 +- configs/typescript.js | 27 +++++++++++++++++++++++++++ index.js | 3 ++- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 configs/typescript.js diff --git a/configs/react-typescript.js b/configs/react-typescript.js index 920ffd1..655debf 100644 --- a/configs/react-typescript.js +++ b/configs/react-typescript.js @@ -5,7 +5,7 @@ const pluginNext = require('@next/eslint-plugin-next'); /** @type {import('eslint').Linter.Config} */ module.exports = [ - { name: 'ESLint config awesome' }, + { name: 'ESLint Config Awesome - React/Next Typescript' }, ...auto, sonarjs.configs.recommended, { diff --git a/configs/typescript.js b/configs/typescript.js new file mode 100644 index 0000000..fdcf6bc --- /dev/null +++ b/configs/typescript.js @@ -0,0 +1,27 @@ +const auto = require('eslint-config-canonical/configurations/auto'); +const sonarjs = require('eslint-plugin-sonarjs'); +const rules = require('../rules'); + +/** @type {import('eslint').Linter.Config} */ +module.exports = [ + { name: 'ESLint Config Awesome - Typescript' }, + ...auto, + sonarjs.configs.recommended, + { + plugins: { + import: require('eslint-plugin-import'), + }, + }, + rules.common, + rules.sonar, + { + ignores: [ + '**/node_modules', + '**/package-lock.json', + '**/pnpm-lock.yaml', + '**/package.json', + '**/tsconfig.json', + '**/eslint.config.js', + ], + }, +]; diff --git a/index.js b/index.js index a075e4c..edaacfc 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,4 @@ const reactTypescript = require('./configs/react-typescript'); +const typescript = require('./configs/typescript'); -module.exports = { 'react-typescript': reactTypescript }; +module.exports = { 'react-typescript': reactTypescript, typescript };