@saashub/qoq-eslint-v9-ts-vitest 0.9.4 → 0.11.0
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 +5 -5
- package/lib/index.cjs +33 -9
- package/lib/index.d.ts +2 -5
- package/lib/index.mjs +14 -9
- package/package.json +8 -22
- package/.prettierrc +0 -1
- package/eslint.config.js +0 -1
- package/lib/baseConfig.cjs +0 -37
- package/lib/baseConfig.d.ts +0 -3
- package/lib/baseConfig.mjs +0 -16
- package/lib/eslintConfig.cjs +0 -22
- package/lib/eslintConfig.d.ts +0 -4
- package/lib/eslintConfig.mjs +0 -17
package/README.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
## Rationale
|
7
7
|
|
8
|
-
Beign tired of setting up [Eslint](https://www.npmjs.com/package/eslint) all over again for new projects on top of v9 [flatConfig](https://eslint.org/docs/latest/use/configure/configuration-files)
|
8
|
+
Beign tired of setting up [Eslint](https://www.npmjs.com/package/eslint) all over again for new projects, on top of v9 [flatConfig](https://eslint.org/docs/latest/use/configure/configuration-files) , we created some base template for different setups (check all [@saashub/qoq-eslint-v9-\* packages](https://www.npmjs.com/search?q=%40saashub%2Fqoq-eslint-v9-)). Configs inherit from base ones and includes all necessary packages and settings. Rules are opinionated, configured from years of development experience, can be used as full setup without any tweaks or as base to Your own configs.
|
9
9
|
|
10
10
|
## Install
|
11
11
|
|
@@ -13,12 +13,12 @@ Beign tired of setting up [Eslint](https://www.npmjs.com/package/eslint) all ove
|
|
13
13
|
|
14
14
|
## Usage
|
15
15
|
|
16
|
-
Package exports both CommonJS and
|
16
|
+
Package exports both CommonJS and ESM code just import it in Your eslint config file.
|
17
17
|
|
18
18
|
### For CommonJS
|
19
19
|
|
20
20
|
```js
|
21
|
-
const jsBaseConfig = require("@saashub/qoq-eslint-v9-ts-vitest
|
21
|
+
const jsBaseConfig = require("@saashub/qoq-eslint-v9-ts-vitest");
|
22
22
|
|
23
23
|
module.exports = [
|
24
24
|
{
|
@@ -28,10 +28,10 @@ module.exports = [
|
|
28
28
|
]
|
29
29
|
```
|
30
30
|
|
31
|
-
### For
|
31
|
+
### For ESM
|
32
32
|
|
33
33
|
```js
|
34
|
-
import jsBaseConfig from '@saashub/qoq-eslint-v9-ts-vitest
|
34
|
+
import jsBaseConfig from '@saashub/qoq-eslint-v9-ts-vitest';
|
35
35
|
|
36
36
|
export default [
|
37
37
|
{
|
package/lib/index.cjs
CHANGED
@@ -1,13 +1,37 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
var
|
4
|
-
var
|
5
|
-
require('@saashub/qoq-eslint-v9-
|
6
|
-
require('
|
7
|
-
require('
|
8
|
-
require('eslint-plugin-import');
|
9
|
-
require('lodash/merge.js');
|
3
|
+
var tools = require('@saashub/qoq-eslint-v9-js/tools');
|
4
|
+
var qoqEslintV9JsVitest = require('@saashub/qoq-eslint-v9-js-vitest');
|
5
|
+
var qoqEslintV9Ts = require('@saashub/qoq-eslint-v9-ts');
|
6
|
+
var importPlugin = require('eslint-plugin-import');
|
7
|
+
var merge = require('lodash/merge.js');
|
10
8
|
|
11
|
-
|
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
|
+
}
|
12
25
|
|
13
|
-
|
26
|
+
var importPlugin__namespace = /*#__PURE__*/_interopNamespaceDefault(importPlugin);
|
27
|
+
|
28
|
+
const baseConfig = merge({},
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
|
30
|
+
tools.omitRules(qoqEslintV9JsVitest.baseConfig, Object.keys(importPlugin__namespace.configs.recommended.rules)), qoqEslintV9Ts.baseConfig, {
|
31
|
+
name: '@saashub/qoq-eslint-v9-ts-vitest',
|
32
|
+
rules: {
|
33
|
+
'sonarjs/no-duplicate-string': 0,
|
34
|
+
},
|
35
|
+
});
|
36
|
+
|
37
|
+
exports.baseConfig = baseConfig;
|
package/lib/index.d.ts
CHANGED
@@ -1,5 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
eslintConfig: import("@saashub/qoq-eslint-v9-js").EslintConfig[];
|
4
|
-
};
|
5
|
-
export default _default;
|
1
|
+
import { EslintConfig } from '@saashub/qoq-eslint-v9-js';
|
2
|
+
export declare const baseConfig: EslintConfig;
|
package/lib/index.mjs
CHANGED
@@ -1,11 +1,16 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
import '@saashub/qoq-eslint-v9-
|
4
|
-
import '
|
5
|
-
import '
|
6
|
-
import 'eslint-plugin-import';
|
7
|
-
import 'lodash/merge.js';
|
1
|
+
import { omitRules } from '@saashub/qoq-eslint-v9-js/tools';
|
2
|
+
import { baseConfig as baseConfig$1 } from '@saashub/qoq-eslint-v9-js-vitest';
|
3
|
+
import { baseConfig as baseConfig$2 } from '@saashub/qoq-eslint-v9-ts';
|
4
|
+
import * as importPlugin from 'eslint-plugin-import';
|
5
|
+
import merge from 'lodash/merge.js';
|
8
6
|
|
9
|
-
|
7
|
+
const baseConfig = merge({},
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-argument
|
9
|
+
omitRules(baseConfig$1, Object.keys(importPlugin.configs.recommended.rules)), baseConfig$2, {
|
10
|
+
name: '@saashub/qoq-eslint-v9-ts-vitest',
|
11
|
+
rules: {
|
12
|
+
'sonarjs/no-duplicate-string': 0,
|
13
|
+
},
|
14
|
+
});
|
10
15
|
|
11
|
-
export {
|
16
|
+
export { baseConfig };
|
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.
|
5
|
+
"version": "0.11.0",
|
6
6
|
"main": "./lib/index.cjs",
|
7
7
|
"module": "./lib/index.mjs",
|
8
8
|
"types": "./lib/index.d.js",
|
@@ -13,20 +13,6 @@
|
|
13
13
|
"import": "./lib/index.mjs",
|
14
14
|
"require": "./lib/index.cjs",
|
15
15
|
"default": "./lib/index.mjs"
|
16
|
-
},
|
17
|
-
"./baseConfig": {
|
18
|
-
"types": "./lib/baseConfig.d.ts",
|
19
|
-
"module": "./lib/baseConfig.mjs",
|
20
|
-
"import": "./lib/baseConfig.mjs",
|
21
|
-
"require": "./lib/baseConfig.cjs",
|
22
|
-
"default": "./lib/baseConfig.mjs"
|
23
|
-
},
|
24
|
-
"./eslintConfig": {
|
25
|
-
"types": "./lib/eslintConfig.d.ts",
|
26
|
-
"module": "./lib/eslintConfig.mjs",
|
27
|
-
"import": "./lib/eslintConfig.mjs",
|
28
|
-
"require": "./lib/eslintConfig.cjs",
|
29
|
-
"default": "./lib/eslintConfig.mjs"
|
30
16
|
}
|
31
17
|
},
|
32
18
|
"publishConfig": {
|
@@ -40,18 +26,18 @@
|
|
40
26
|
"inspect": "npm run build && eslint -c ./lib/eslintConfig.cjs --inspect-config"
|
41
27
|
},
|
42
28
|
"dependencies": {
|
43
|
-
"@saashub/qoq-eslint-v9-js-vitest": "^0.
|
44
|
-
"@saashub/qoq-eslint-v9-ts": "^0.
|
29
|
+
"@saashub/qoq-eslint-v9-js-vitest": "^0.11.0",
|
30
|
+
"@saashub/qoq-eslint-v9-ts": "^0.11.0",
|
45
31
|
"lodash": "4.17.21"
|
46
32
|
},
|
47
33
|
"devDependencies": {
|
48
|
-
"@rollup/plugin-typescript": "
|
49
|
-
"@saashub/qoq-cli": "^0.
|
34
|
+
"@rollup/plugin-typescript": "12.1.0",
|
35
|
+
"@saashub/qoq-cli": "^0.11.0",
|
50
36
|
"@types/eslint": "^9",
|
51
|
-
"@types/lodash": "4.17.
|
37
|
+
"@types/lodash": "4.17.9",
|
52
38
|
"@vitest/coverage-v8": "2.1.1",
|
53
39
|
"rimraf": "6.0.1",
|
54
|
-
"rollup": "4.22.
|
40
|
+
"rollup": "4.22.4",
|
55
41
|
"typescript": "5.6.2",
|
56
42
|
"vitest": "2.1.1"
|
57
43
|
},
|
@@ -71,5 +57,5 @@
|
|
71
57
|
"directory": "packages/eslint-v9-ts-vitest"
|
72
58
|
},
|
73
59
|
"homepage": "https://github.com/saashub-it/qoq/tree/master/packages/eslint-v9-ts-vitest",
|
74
|
-
"gitHead": "
|
60
|
+
"gitHead": "1c4b02e30bbddf9dbf58c442532cf5cef35414c1"
|
75
61
|
}
|
package/.prettierrc
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
"@saashub/qoq-prettier"
|
package/eslint.config.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
const config = require('./bin/eslint.config.js'); module.exports = config;
|
package/lib/baseConfig.cjs
DELETED
@@ -1,37 +0,0 @@
|
|
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;
|
package/lib/baseConfig.d.ts
DELETED
package/lib/baseConfig.mjs
DELETED
@@ -1,16 +0,0 @@
|
|
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 };
|
package/lib/eslintConfig.cjs
DELETED
@@ -1,22 +0,0 @@
|
|
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;
|
package/lib/eslintConfig.d.ts
DELETED
package/lib/eslintConfig.mjs
DELETED
@@ -1,17 +0,0 @@
|
|
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 };
|