@virmator/lint 13.0.2 → 13.0.4

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.
@@ -0,0 +1,20 @@
1
+ {
2
+ "100": true,
3
+ "all": true,
4
+ "checkCoverage": true,
5
+ "clean": true,
6
+ "exclude": [
7
+ "**/*.test.ts",
8
+ "**/*.example.ts",
9
+ "**/*.test-helper.ts"
10
+ ],
11
+ "include": [
12
+ "src/**/*.ts"
13
+ ],
14
+ "perFile": true,
15
+ "reporter": [
16
+ "html",
17
+ "istanbul-smart-text-reporter"
18
+ ],
19
+ "skipFull": true
20
+ }
@@ -0,0 +1,142 @@
1
+ import jsEslint from '@eslint/js';
2
+ import stylistic from '@stylistic/eslint-plugin';
3
+ import jsdoc from 'eslint-plugin-jsdoc';
4
+ import prettierEslintRecommended from 'eslint-plugin-prettier/recommended';
5
+ import sonarJsEslint from 'eslint-plugin-sonarjs';
6
+ import globals from 'globals';
7
+ import {existsSync} from 'node:fs';
8
+ import {join} from 'node:path';
9
+ import tsEslint from 'typescript-eslint';
10
+
11
+ const globalVars = {
12
+ ...globals.node,
13
+ ...globals.browser,
14
+ };
15
+
16
+ function determineTsconfigPath(repoDir) {
17
+ const eslintTsconfig = join(repoDir, 'configs', 'tsconfig.eslint.json');
18
+ const rootTsconfig = join(repoDir, 'tsconfig.json');
19
+
20
+ if (existsSync(eslintTsconfig)) {
21
+ return eslintTsconfig;
22
+ } else {
23
+ return rootTsconfig;
24
+ }
25
+ }
26
+
27
+ export function defineEslintConfig(repoDir) {
28
+ return [
29
+ {
30
+ ignores: [
31
+ '*.graphql',
32
+ '*.html',
33
+ '*.json',
34
+ '*.sh',
35
+ '*.sql',
36
+ '*.yml',
37
+ '**/configs/',
38
+ '**/coverage/',
39
+ '**/dist/',
40
+ 'cspell.config.cjs',
41
+ 'package-lock.json',
42
+ ],
43
+ },
44
+ jsEslint.configs.recommended,
45
+ ...tsEslint.configs.strictTypeChecked,
46
+ sonarJsEslint.configs.recommended,
47
+ prettierEslintRecommended,
48
+ {
49
+ languageOptions: {
50
+ parserOptions: {
51
+ project: [
52
+ determineTsconfigPath(repoDir),
53
+ ],
54
+ },
55
+ globals: globalVars,
56
+ },
57
+ plugins: {
58
+ '@stylistic': stylistic,
59
+ '@jsdoc': jsdoc,
60
+ },
61
+ rules: {
62
+ '@typescript-eslint/no-dynamic-delete': 'off',
63
+ '@typescript-eslint/no-explicit-any': 'off',
64
+ '@typescript-eslint/no-invalid-void-type': 'off',
65
+ '@typescript-eslint/no-unnecessary-type-parameters': 'off',
66
+ '@typescript-eslint/no-unsafe-argument': 'off',
67
+ '@typescript-eslint/no-unsafe-assignment': 'off',
68
+ '@typescript-eslint/no-unsafe-call': 'off',
69
+ '@typescript-eslint/no-unsafe-enum-comparison': 'off',
70
+ '@typescript-eslint/no-unsafe-member-access': 'off',
71
+ 'prettier/prettier': 'off',
72
+ 'sonarjs/no-duplicate-string': 'off',
73
+
74
+ '@jsdoc/no-undefined-types': 'error',
75
+ '@typescript-eslint/await-thenable': 'error',
76
+ '@typescript-eslint/no-unused-vars': 'error',
77
+
78
+ '@typescript-eslint/no-floating-promises': [
79
+ 'error',
80
+ {
81
+ allowForKnownSafeCalls: [
82
+ {
83
+ from: 'package',
84
+ package: 'node:test',
85
+ name: [
86
+ 'describe',
87
+ 'it',
88
+ ],
89
+ },
90
+ ],
91
+ checkThenables: true,
92
+ },
93
+ ],
94
+ '@typescript-eslint/no-confusing-void-expression': [
95
+ 'error',
96
+ {
97
+ ignoreArrowShorthand: true,
98
+ },
99
+ ],
100
+ '@stylistic/padding-line-between-statements': [
101
+ 'error',
102
+ /** Require new lines between imports and everything else. */
103
+ {
104
+ blankLine: 'always',
105
+ prev: 'import',
106
+ next: '*',
107
+ },
108
+ /** Do not require new lines between imports and other imports. */
109
+ {
110
+ blankLine: 'any',
111
+ prev: 'import',
112
+ next: 'import',
113
+ },
114
+ ],
115
+ '@typescript-eslint/restrict-template-expressions': [
116
+ 'error',
117
+ {
118
+ allowNumber: true,
119
+ },
120
+ ],
121
+ 'no-console': [
122
+ 'error',
123
+ {
124
+ allow: [
125
+ 'info',
126
+ 'error',
127
+ 'warn',
128
+ ],
129
+ },
130
+ ],
131
+ },
132
+ },
133
+ {
134
+ files: [
135
+ '**/*.js',
136
+ '**/*.cjs',
137
+ '**/*.mjs',
138
+ ],
139
+ ...tsEslint.configs.disableTypeChecked,
140
+ },
141
+ ];
142
+ }
@@ -0,0 +1,13 @@
1
+ import {defineEslintConfig} from '@virmator/lint/configs/eslint.config.base.mjs';
2
+ import {dirname} from 'node:path';
3
+ import {fileURLToPath} from 'node:url';
4
+
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = dirname(__filename);
7
+
8
+ export default [
9
+ ...defineEslintConfig(__dirname),
10
+ {
11
+ ignores: [],
12
+ },
13
+ ];
@@ -0,0 +1,20 @@
1
+ import {baseTypedocConfig} from '@virmator/docs/configs/typedoc.config.base';
2
+ import {join, resolve} from 'path';
3
+ import type {TypeDocOptions} from 'typedoc';
4
+
5
+ const repoRoot = resolve(
6
+ __dirname,
7
+ /** Go up two directories because this gets compiled into `node_modules/.virmator` */
8
+ '..',
9
+ '..',
10
+ );
11
+ const indexTsFile = join(repoRoot, 'src', 'lint.ts');
12
+
13
+ export const typeDocConfig: Partial<TypeDocOptions> = {
14
+ ...baseTypedocConfig,
15
+ out: join(repoRoot, 'dist-docs'),
16
+ entryPoints: [
17
+ indexTsFile,
18
+ ],
19
+ intentionallyNotExported: [],
20
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@virmator/lint",
3
- "version": "13.0.2",
3
+ "version": "13.0.4",
4
4
  "description": "Default ESLint linting plugin for virmator.",
5
5
  "keywords": [
6
6
  "virmator",