@saashub/qoq-eslint-v9-ts-vitest 0.7.4 → 0.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @saashub/qoq-eslint-v9-ts-vitest
2
2
 
3
- ![NPM Version](https://img.shields.io/npm/v/%40saashub%2Fqoq-eslint-v9-ts-vitest)
3
+ ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/saashub-it/qoq/main.yml) ![NPM Version](https://img.shields.io/npm/v/%40saashub%2Fqoq-eslint-v9-ts-vitest)
4
4
  ![NPM Type Definitions](https://img.shields.io/npm/types/%40saashub%2Fqoq-eslint-v9-ts-vitest) ![NPM Unpacked Size](https://img.shields.io/npm/unpacked-size/%40saashub%2Fqoq-eslint-v9-ts-vitest) ![NPM License](https://img.shields.io/npm/l/%40saashub%2Fqoq-eslint-v9-ts-vitest)
5
5
 
6
6
  ## Rationale
package/lib/baseConfig.js CHANGED
@@ -1,10 +1,31 @@
1
1
  'use strict';
2
2
 
3
+ var tools = require('@saashub/qoq-eslint-v9-js/tools');
4
+ var importPlugin = require('eslint-plugin-import');
3
5
  var jsVitestBaseConfig = require('@saashub/qoq-eslint-v9-js-vitest/baseConfig');
4
6
  var tsBaseConfig = require('@saashub/qoq-eslint-v9-ts/baseConfig');
5
7
  var merge = require('lodash/merge.js');
6
8
 
7
- const config = merge({}, jsVitestBaseConfig, tsBaseConfig, {
9
+ function _interopNamespaceDefault(e) {
10
+ var n = Object.create(null);
11
+ if (e) {
12
+ Object.keys(e).forEach(function (k) {
13
+ if (k !== 'default') {
14
+ var d = Object.getOwnPropertyDescriptor(e, k);
15
+ Object.defineProperty(n, k, d.get ? d : {
16
+ enumerable: true,
17
+ get: function () { return e[k]; }
18
+ });
19
+ }
20
+ });
21
+ }
22
+ n.default = e;
23
+ return Object.freeze(n);
24
+ }
25
+
26
+ var importPlugin__namespace = /*#__PURE__*/_interopNamespaceDefault(importPlugin);
27
+
28
+ const config = merge({}, tools.omitRules(jsVitestBaseConfig, Object.keys(importPlugin__namespace.configs.recommended.rules)), tsBaseConfig, {
8
29
  name: '@saashub/qoq-eslint-v9-ts-vitest',
9
30
  rules: {
10
31
  'sonarjs/no-duplicate-string': 0,
@@ -1,8 +1,10 @@
1
+ import { omitRules } from '@saashub/qoq-eslint-v9-js/tools';
2
+ import * as importPlugin from 'eslint-plugin-import';
1
3
  import jsVitestBaseConfig from '@saashub/qoq-eslint-v9-js-vitest/baseConfig';
2
4
  import tsBaseConfig from '@saashub/qoq-eslint-v9-ts/baseConfig';
3
5
  import merge from 'lodash/merge.js';
4
6
 
5
- const config = merge({}, jsVitestBaseConfig, tsBaseConfig, {
7
+ const config = merge({}, omitRules(jsVitestBaseConfig, Object.keys(importPlugin.configs.recommended.rules)), tsBaseConfig, {
6
8
  name: '@saashub/qoq-eslint-v9-ts-vitest',
7
9
  rules: {
8
10
  'sonarjs/no-duplicate-string': 0,
@@ -3,6 +3,8 @@
3
3
  var tsEslintConfig = require('@saashub/qoq-eslint-v9-ts/eslintConfig');
4
4
  var merge = require('lodash/merge.js');
5
5
  var baseConfig = require('./baseConfig.js');
6
+ require('@saashub/qoq-eslint-v9-js/tools');
7
+ require('eslint-plugin-import');
6
8
  require('@saashub/qoq-eslint-v9-js-vitest/baseConfig');
7
9
  require('@saashub/qoq-eslint-v9-ts/baseConfig');
8
10
 
@@ -1,6 +1,8 @@
1
1
  import tsEslintConfig from '@saashub/qoq-eslint-v9-ts/eslintConfig';
2
2
  import merge from 'lodash/merge.js';
3
3
  import config from './baseConfig.mjs';
4
+ import '@saashub/qoq-eslint-v9-js/tools';
5
+ import 'eslint-plugin-import';
4
6
  import '@saashub/qoq-eslint-v9-js-vitest/baseConfig';
5
7
  import '@saashub/qoq-eslint-v9-ts/baseConfig';
6
8
 
package/lib/index.js CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  var baseConfig = require('./baseConfig.js');
4
4
  var eslintConfig = require('./eslintConfig.js');
5
+ require('@saashub/qoq-eslint-v9-js/tools');
6
+ require('eslint-plugin-import');
5
7
  require('@saashub/qoq-eslint-v9-js-vitest/baseConfig');
6
8
  require('@saashub/qoq-eslint-v9-ts/baseConfig');
7
9
  require('lodash/merge.js');
package/lib/index.mjs CHANGED
@@ -1,5 +1,7 @@
1
1
  import config from './baseConfig.mjs';
2
2
  import eslintConfig from './eslintConfig.mjs';
3
+ import '@saashub/qoq-eslint-v9-js/tools';
4
+ import 'eslint-plugin-import';
3
5
  import '@saashub/qoq-eslint-v9-js-vitest/baseConfig';
4
6
  import '@saashub/qoq-eslint-v9-ts/baseConfig';
5
7
  import 'lodash/merge.js';
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@saashub/qoq-eslint-v9-ts-vitest",
3
3
  "description": "Eslint flat config template for TS + Vitest",
4
4
  "license": "MIT",
5
- "version": "0.7.4",
5
+ "version": "0.7.6",
6
6
  "main": "./lib/index.js",
7
7
  "module": "./lib/index.mjs",
8
8
  "types": "./lib/index.d.js",
@@ -33,11 +33,12 @@
33
33
  "access": "public"
34
34
  },
35
35
  "scripts": {
36
- "build": "rimraf ./lib && rollup -c --silent"
36
+ "build": "rimraf ./lib && rollup -c --silent",
37
+ "inspect": "npm run build && eslint -c ./lib/eslintConfig.js --inspect-config"
37
38
  },
38
39
  "dependencies": {
39
- "@saashub/qoq-eslint-v9-js-vitest": "^0.7.4",
40
- "@saashub/qoq-eslint-v9-ts": "^0.7.4",
40
+ "@saashub/qoq-eslint-v9-js-vitest": "^0.7.6",
41
+ "@saashub/qoq-eslint-v9-ts": "^0.7.6",
41
42
  "lodash": "4.17.21"
42
43
  },
43
44
  "devDependencies": {
@@ -45,7 +46,7 @@
45
46
  "@types/eslint": "^9",
46
47
  "@types/lodash": "4.17.7",
47
48
  "rimraf": "6.0.1",
48
- "rollup": "4.21.0",
49
+ "rollup": "4.21.1",
49
50
  "typescript": "5.5.4"
50
51
  },
51
52
  "peerDependencies": {
@@ -64,5 +65,5 @@
64
65
  "directory": "packages/eslint-v9-ts-vitest"
65
66
  },
66
67
  "homepage": "https://github.com/saashub-it/qoq/tree/master/packages/eslint-v9-ts-vitest",
67
- "gitHead": "25afae5edb4d2bfcf293c268a8f6b20fa039d90d"
68
+ "gitHead": "c53363c935828ff01447c1d49b5851e891b0ac60"
68
69
  }
package/src/baseConfig.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { omitRules } from '@saashub/qoq-eslint-v9-js/tools';
2
+ import * as importPlugin from 'eslint-plugin-import';
1
3
  import jsVitestBaseConfig from '@saashub/qoq-eslint-v9-js-vitest/baseConfig';
2
4
  import tsBaseConfig from '@saashub/qoq-eslint-v9-ts/baseConfig';
3
5
 
@@ -5,11 +7,16 @@ import merge from 'lodash/merge.js';
5
7
 
6
8
  import type { Linter } from 'eslint';
7
9
 
8
- const config = merge({}, jsVitestBaseConfig, tsBaseConfig, {
9
- name: '@saashub/qoq-eslint-v9-ts-vitest',
10
- rules: {
11
- 'sonarjs/no-duplicate-string': 0,
12
- },
13
- }) as unknown as Linter.Config;
10
+ const config = merge(
11
+ {},
12
+ omitRules(jsVitestBaseConfig, Object.keys(importPlugin.configs.recommended.rules)),
13
+ tsBaseConfig,
14
+ {
15
+ name: '@saashub/qoq-eslint-v9-ts-vitest',
16
+ rules: {
17
+ 'sonarjs/no-duplicate-string': 0,
18
+ },
19
+ }
20
+ ) as unknown as Linter.Config;
14
21
 
15
22
  export default config;
@@ -1,9 +1,10 @@
1
1
  import { describe, test, expect } from 'vitest';
2
+ import { execSync } from 'child_process';
2
3
  import { ESLint } from 'eslint';
3
4
 
4
5
  import eslintConfig from './eslintConfig';
5
6
 
6
- describe('eslintConfig', () => {
7
+ describe('baseConfig', () => {
7
8
  test('can constuct Eslint object', () => {
8
9
  expect(
9
10
  () =>
@@ -12,4 +13,12 @@ describe('eslintConfig', () => {
12
13
  })
13
14
  ).not.toThrowError();
14
15
  });
16
+
17
+ test('can execute Eslint with compiled config', async () => {
18
+ const projectPath = __dirname.replace('/src', '');
19
+
20
+ expect(() =>
21
+ execSync(`eslint ${projectPath}/lib/index.js -c ${projectPath}/lib/eslintConfig.js `)
22
+ ).not.toThrowError();
23
+ });
15
24
  });