@saashub/qoq-eslint-v9-ts-vitest 0.9.0 → 0.9.2
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/lib/baseConfig.cjs +37 -0
- package/lib/baseConfig.d.ts +3 -0
- package/lib/baseConfig.mjs +16 -0
- package/lib/eslintConfig.cjs +22 -0
- package/lib/eslintConfig.d.ts +4 -0
- package/lib/eslintConfig.mjs +17 -0
- package/lib/index.cjs +13 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.mjs +11 -0
- package/package.json +5 -5
- package/qoq.config.js +0 -3
- package/rollup.config.mjs +0 -3
- package/src/baseConfig.spec.ts +0 -15
- package/src/baseConfig.ts +0 -21
- package/src/eslintConfig.spec.ts +0 -26
- package/src/eslintConfig.ts +0 -23
- package/src/index.ts +0 -4
- package/tsconfig.json +0 -7
- package/vitest.config.mjs +0 -3
@@ -0,0 +1,37 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var tools = require('@saashub/qoq-eslint-v9-js/tools');
|
4
|
+
var jsVitestBaseConfig = require('@saashub/qoq-eslint-v9-js-vitest/baseConfig');
|
5
|
+
var tsBaseConfig = require('@saashub/qoq-eslint-v9-ts/baseConfig');
|
6
|
+
var importPlugin = require('eslint-plugin-import');
|
7
|
+
var merge = require('lodash/merge.js');
|
8
|
+
|
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({},
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
|
30
|
+
tools.omitRules(jsVitestBaseConfig, Object.keys(importPlugin__namespace.configs.recommended.rules)), tsBaseConfig, {
|
31
|
+
name: '@saashub/qoq-eslint-v9-ts-vitest',
|
32
|
+
rules: {
|
33
|
+
'sonarjs/no-duplicate-string': 0,
|
34
|
+
},
|
35
|
+
});
|
36
|
+
|
37
|
+
module.exports = config;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { omitRules } from '@saashub/qoq-eslint-v9-js/tools';
|
2
|
+
import jsVitestBaseConfig from '@saashub/qoq-eslint-v9-js-vitest/baseConfig';
|
3
|
+
import tsBaseConfig from '@saashub/qoq-eslint-v9-ts/baseConfig';
|
4
|
+
import * as importPlugin from 'eslint-plugin-import';
|
5
|
+
import merge from 'lodash/merge.js';
|
6
|
+
|
7
|
+
const config = merge({},
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
|
9
|
+
omitRules(jsVitestBaseConfig, Object.keys(importPlugin.configs.recommended.rules)), tsBaseConfig, {
|
10
|
+
name: '@saashub/qoq-eslint-v9-ts-vitest',
|
11
|
+
rules: {
|
12
|
+
'sonarjs/no-duplicate-string': 0,
|
13
|
+
},
|
14
|
+
});
|
15
|
+
|
16
|
+
export { config as default };
|
@@ -0,0 +1,22 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
var merge = require('lodash/merge.js');
|
6
|
+
var baseConfig = require('./baseConfig.cjs');
|
7
|
+
require('@saashub/qoq-eslint-v9-js/tools');
|
8
|
+
require('@saashub/qoq-eslint-v9-js-vitest/baseConfig');
|
9
|
+
require('@saashub/qoq-eslint-v9-ts/baseConfig');
|
10
|
+
require('eslint-plugin-import');
|
11
|
+
|
12
|
+
const filesExtensions = ['js', 'ts'];
|
13
|
+
const getEslintConfig = (srcPath = 'src', files = [`${srcPath}/**/*.spec.{${filesExtensions.join(',')}}`], ignores = []) => [
|
14
|
+
merge({}, baseConfig, {
|
15
|
+
files,
|
16
|
+
ignores,
|
17
|
+
}),
|
18
|
+
];
|
19
|
+
var eslintConfig = getEslintConfig();
|
20
|
+
|
21
|
+
exports.default = eslintConfig;
|
22
|
+
exports.getEslintConfig = getEslintConfig;
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import merge from 'lodash/merge.js';
|
2
|
+
import config from './baseConfig.mjs';
|
3
|
+
import '@saashub/qoq-eslint-v9-js/tools';
|
4
|
+
import '@saashub/qoq-eslint-v9-js-vitest/baseConfig';
|
5
|
+
import '@saashub/qoq-eslint-v9-ts/baseConfig';
|
6
|
+
import 'eslint-plugin-import';
|
7
|
+
|
8
|
+
const filesExtensions = ['js', 'ts'];
|
9
|
+
const getEslintConfig = (srcPath = 'src', files = [`${srcPath}/**/*.spec.{${filesExtensions.join(',')}}`], ignores = []) => [
|
10
|
+
merge({}, config, {
|
11
|
+
files,
|
12
|
+
ignores,
|
13
|
+
}),
|
14
|
+
];
|
15
|
+
var eslintConfig = getEslintConfig();
|
16
|
+
|
17
|
+
export { eslintConfig as default, getEslintConfig };
|
package/lib/index.cjs
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var baseConfig = require('./baseConfig.cjs');
|
4
|
+
var eslintConfig = require('./eslintConfig.cjs');
|
5
|
+
require('@saashub/qoq-eslint-v9-js/tools');
|
6
|
+
require('@saashub/qoq-eslint-v9-js-vitest/baseConfig');
|
7
|
+
require('@saashub/qoq-eslint-v9-ts/baseConfig');
|
8
|
+
require('eslint-plugin-import');
|
9
|
+
require('lodash/merge.js');
|
10
|
+
|
11
|
+
var index = { baseConfig, eslintConfig: eslintConfig.default };
|
12
|
+
|
13
|
+
module.exports = index;
|
package/lib/index.d.ts
ADDED
package/lib/index.mjs
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
import config from './baseConfig.mjs';
|
2
|
+
import eslintConfig from './eslintConfig.mjs';
|
3
|
+
import '@saashub/qoq-eslint-v9-js/tools';
|
4
|
+
import '@saashub/qoq-eslint-v9-js-vitest/baseConfig';
|
5
|
+
import '@saashub/qoq-eslint-v9-ts/baseConfig';
|
6
|
+
import 'eslint-plugin-import';
|
7
|
+
import 'lodash/merge.js';
|
8
|
+
|
9
|
+
var index = { baseConfig: config, eslintConfig };
|
10
|
+
|
11
|
+
export { index as default };
|
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.9.
|
5
|
+
"version": "0.9.2",
|
6
6
|
"main": "./lib/index.cjs",
|
7
7
|
"module": "./lib/index.mjs",
|
8
8
|
"types": "./lib/index.d.js",
|
@@ -40,13 +40,13 @@
|
|
40
40
|
"inspect": "npm run build && eslint -c ./lib/eslintConfig.cjs --inspect-config"
|
41
41
|
},
|
42
42
|
"dependencies": {
|
43
|
-
"@saashub/qoq-eslint-v9-js-vitest": "^0.9.
|
44
|
-
"@saashub/qoq-eslint-v9-ts": "^0.9.
|
43
|
+
"@saashub/qoq-eslint-v9-js-vitest": "^0.9.2",
|
44
|
+
"@saashub/qoq-eslint-v9-ts": "^0.9.2",
|
45
45
|
"lodash": "4.17.21"
|
46
46
|
},
|
47
47
|
"devDependencies": {
|
48
48
|
"@rollup/plugin-typescript": "11.1.6",
|
49
|
-
"@saashub/qoq-cli": "^0.9.
|
49
|
+
"@saashub/qoq-cli": "^0.9.2",
|
50
50
|
"@types/eslint": "^9",
|
51
51
|
"@types/lodash": "4.17.7",
|
52
52
|
"@vitest/coverage-v8": "2.0.5",
|
@@ -71,5 +71,5 @@
|
|
71
71
|
"directory": "packages/eslint-v9-ts-vitest"
|
72
72
|
},
|
73
73
|
"homepage": "https://github.com/saashub-it/qoq/tree/master/packages/eslint-v9-ts-vitest",
|
74
|
-
"gitHead": "
|
74
|
+
"gitHead": "2b61f88d462473c3ad5e6f42b967e6183ee9c84d"
|
75
75
|
}
|
package/qoq.config.js
DELETED
package/rollup.config.mjs
DELETED
package/src/baseConfig.spec.ts
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
import { ESLint } from 'eslint';
|
2
|
-
import { describe, it, expect } from 'vitest';
|
3
|
-
|
4
|
-
import baseConfig from './baseConfig';
|
5
|
-
|
6
|
-
describe('baseConfig', () => {
|
7
|
-
it('can constuct Eslint object', () => {
|
8
|
-
expect(
|
9
|
-
() =>
|
10
|
-
new ESLint({
|
11
|
-
baseConfig,
|
12
|
-
})
|
13
|
-
).not.toThrowError();
|
14
|
-
});
|
15
|
-
});
|
package/src/baseConfig.ts
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
import { EslintConfig } from '@saashub/qoq-eslint-v9-js';
|
2
|
-
import { omitRules } from '@saashub/qoq-eslint-v9-js/tools';
|
3
|
-
import jsVitestBaseConfig from '@saashub/qoq-eslint-v9-js-vitest/baseConfig';
|
4
|
-
import tsBaseConfig from '@saashub/qoq-eslint-v9-ts/baseConfig';
|
5
|
-
import * as importPlugin from 'eslint-plugin-import';
|
6
|
-
import merge from 'lodash/merge.js';
|
7
|
-
|
8
|
-
const config: EslintConfig = merge(
|
9
|
-
{},
|
10
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
|
11
|
-
omitRules(jsVitestBaseConfig, Object.keys(importPlugin.configs.recommended.rules)),
|
12
|
-
tsBaseConfig,
|
13
|
-
{
|
14
|
-
name: '@saashub/qoq-eslint-v9-ts-vitest',
|
15
|
-
rules: {
|
16
|
-
'sonarjs/no-duplicate-string': 0,
|
17
|
-
},
|
18
|
-
}
|
19
|
-
);
|
20
|
-
|
21
|
-
export default config;
|
package/src/eslintConfig.spec.ts
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
import { execSync } from 'child_process';
|
2
|
-
|
3
|
-
import { ESLint } from 'eslint';
|
4
|
-
import { describe, it, expect } from 'vitest';
|
5
|
-
|
6
|
-
import { getEslintConfig } from './eslintConfig';
|
7
|
-
|
8
|
-
describe('baseConfig', () => {
|
9
|
-
it('can constuct Eslint object', () => {
|
10
|
-
expect(
|
11
|
-
() =>
|
12
|
-
new ESLint({
|
13
|
-
baseConfig: getEslintConfig(),
|
14
|
-
})
|
15
|
-
).not.toThrowError();
|
16
|
-
});
|
17
|
-
|
18
|
-
it('can execute Eslint with compiled config', () => {
|
19
|
-
const projectPath = __dirname.replace('/src', '');
|
20
|
-
|
21
|
-
expect(() =>
|
22
|
-
// eslint-disable-next-line sonarjs/os-command
|
23
|
-
execSync(`eslint ${projectPath}/lib/index.cjs -c ${projectPath}/lib/eslintConfig.mjs`)
|
24
|
-
).not.toThrowError();
|
25
|
-
});
|
26
|
-
});
|
package/src/eslintConfig.ts
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
import { EslintConfig } from '@saashub/qoq-eslint-v9-js';
|
2
|
-
import merge from 'lodash/merge.js';
|
3
|
-
|
4
|
-
import baseConfig from './baseConfig';
|
5
|
-
|
6
|
-
const filesExtensions = ['js', 'ts'];
|
7
|
-
|
8
|
-
export const getEslintConfig: (
|
9
|
-
srcPath?: string,
|
10
|
-
files?: string[],
|
11
|
-
ignores?: string[]
|
12
|
-
) => EslintConfig[] = (
|
13
|
-
srcPath = 'src',
|
14
|
-
files = [`${srcPath}/**/*.spec.{${filesExtensions.join(',')}}`],
|
15
|
-
ignores = []
|
16
|
-
) => [
|
17
|
-
merge({}, baseConfig, {
|
18
|
-
files,
|
19
|
-
ignores,
|
20
|
-
}),
|
21
|
-
];
|
22
|
-
|
23
|
-
export default getEslintConfig();
|
package/src/index.ts
DELETED
package/tsconfig.json
DELETED
package/vitest.config.mjs
DELETED