From 79fd6e90ed75ee4b8efcb65c983cdf62cafe0367 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Wed, 19 Jul 2023 16:25:13 +0300 Subject: [PATCH] configs: divided configs into files --- core.js | 24 ++++++++++++++++++++++++ graphql.js | 17 +++++++++++++++++ json.js | 16 ++++++++++++++++ next.js | 21 +++++++++++++++++++++ package.json | 2 +- testing.js | 17 +++++++++++++++++ zod.js | 16 ++++++++++++++++ 7 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 core.js create mode 100644 graphql.js create mode 100644 json.js create mode 100644 next.js create mode 100644 testing.js create mode 100644 zod.js diff --git a/core.js b/core.js new file mode 100644 index 0000000..8e7b395 --- /dev/null +++ b/core.js @@ -0,0 +1,24 @@ +module.exports = { + env: { + browser: true, + es2022: true, + node: true, + }, + parserOptions: { + ecmaVersion: 2022, + }, + parser: '@typescript-eslint/parser', + extends: [ + 'canonical', + 'plugin:sonarjs/recommended', + 'eslint:recommended', + 'prettier', + ], + overrides: [ + { + extends: ['canonical/typescript'], + files: '*.ts', + }, + ], + plugins: ['canonical', 'sonarjs', '@typescript-eslint', 'prettier'], +}; diff --git a/graphql.js b/graphql.js new file mode 100644 index 0000000..11417d9 --- /dev/null +++ b/graphql.js @@ -0,0 +1,17 @@ +module.exports = { + env: { + browser: true, + es2022: true, + node: true, + }, + parserOptions: { + ecmaVersion: 2022, + }, + overrides: [ + + { + extends: ['canonical/graphql'], + files: ['*.graphql'], + }, + ], +}; diff --git a/json.js b/json.js new file mode 100644 index 0000000..6bd05fd --- /dev/null +++ b/json.js @@ -0,0 +1,16 @@ +module.exports = { + env: { + browser: true, + es2022: true, + node: true, + }, + parserOptions: { + ecmaVersion: 2022, + }, + overrides: [ + { + extends: ['canonical/json'], + files: '*.json', + }, + ], +}; diff --git a/next.js b/next.js new file mode 100644 index 0000000..bb85edb --- /dev/null +++ b/next.js @@ -0,0 +1,21 @@ +module.exports = { + env: { + browser: true, + es2022: true, + node: true, + }, + parserOptions: { + ecmaVersion: 2022, + }, + extends: ['next'], + overrides: [ + { + extends: ['canonical/react', 'canonical/typescript'], + files: '*.tsx', + }, + { + extends: ['canonical/react'], + files: '*.jsx', + }, + ], +}; diff --git a/package.json b/package.json index 3efbbb1..c0bf722 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@vchikalkin/eslint-config-awesome", - "version": "1.0.0", + "version": "1.0.1", "license": "MIT", "main": "index.js", "devDependencies": { diff --git a/testing.js b/testing.js new file mode 100644 index 0000000..91c1379 --- /dev/null +++ b/testing.js @@ -0,0 +1,17 @@ +module.exports = { + env: { + browser: true, + es2022: true, + node: true, + }, + parserOptions: { + ecmaVersion: 2022, + }, + overrides: [ + { + files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'], + extends: ['plugin:testing-library/react', 'canonical/jest'], + }, + ], + plugins: ['testing-library'], +}; diff --git a/zod.js b/zod.js new file mode 100644 index 0000000..f2c0442 --- /dev/null +++ b/zod.js @@ -0,0 +1,16 @@ +module.exports = { + env: { + browser: true, + es2022: true, + node: true, + }, + parserOptions: { + ecmaVersion: 2022, + }, + overrides: [ + { + extends: ['canonical/zod'], + files: '*.ts', + }, + ], +};