oxlint-plugin-stamhoofd 2.120.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/LICENSE.md ADDED
@@ -0,0 +1,32 @@
1
+ Free Use License for Non-Profit Organizations
2
+
3
+ Copyright 2020 Codawood BV
4
+
5
+ Permission is hereby granted, free of charge, to any non-profit organization with fewer than 2,000 members (each, a “Licensee”), to use this software and associated documentation files (the “Software”), subject to the following conditions:
6
+
7
+ 1. Eligibility:
8
+ This license applies only if neither the Licensee nor, if applicable, its parent or umbrella organization, is already subject to an existing license for this project. For the purposes of this license, a “parent or umbrella organization” means any organization with which the Licensee is affiliated, coordinated, or represented as part of a larger collective, including but not limited to national associations or federations.
9
+
10
+ 2. Modifications:
11
+ Modifications to the Software are permitted only if they are published publicly under the MIT License, covering only the modifications; the original Software remains under this license and may not be sublicensed without a separate agreement. Any modification made by a Licensee (other than modifications by the original author, its representatives, or the copyright owner) shall be deemed to be distributed under the MIT License. Submission of modifications through publicly accessible channels, including but not limited to pull requests on code repositories such as GitHub, shall be considered an explicit acknowledgment and grant by the Licensee that such modifications are made available under the MIT License. Licensees may not sublicense, transfer, or assign the rights granted under this license except as expressly permitted herein.
12
+
13
+ 3. Precedence of Existing Licenses:
14
+ If the Licensee, or its parent or umbrella organization, is already subject to an existing license for this project, that license shall take precedence, and no additional free license is granted. Nothing in this license shall be construed to override any pre-existing exclusive license agreement.
15
+
16
+ 4. Data Protection / GDPR Responsibility:
17
+ Licensees are solely responsible for ensuring that any processing of personal data using this software complies with applicable data protection laws, including the EU General Data Protection Regulation (GDPR).
18
+
19
+ 5. Termination and Revocation:
20
+ The copyright holders may revoke this license at any time, at their sole discretion.
21
+
22
+ 6. Governing Law:
23
+ This license shall be governed by and construed in accordance with the laws of Belgium, without regard to conflict of law principles.
24
+
25
+ 7. Third-Party Licenses:
26
+ Certain files or components included in the Software may be governed by separate licenses, including open-source licenses, or contributed by third parties under different terms. Such files are not automatically covered by this license. Licensees are responsible for reviewing and complying with any additional license terms that apply to these files.
27
+
28
+ For the purposes of this license, a “non-profit organization” means an entity recognized as non-profit under applicable law in its jurisdiction, which does not distribute profits to its members or owners.
29
+
30
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31
+
32
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ This is still WIP
package/package.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "oxlint-plugin-stamhoofd",
3
+ "version": "2.120.0",
4
+ "main": "./src/index.js",
5
+ "license": "UNLICENCED",
6
+ "sideEffects": false,
7
+ "type": "module",
8
+ "files": [
9
+ "src"
10
+ ],
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "dependencies": {
15
+ "oxlint-tsgolint": "^0.17.0"
16
+ },
17
+ "gitHead": "f38f79c15ce16b0c8c14743ff3eb61feda5a18d4"
18
+ }
@@ -0,0 +1,76 @@
1
+ export default {
2
+ plugins: ['import'],
3
+ rules: {
4
+ // Recommended
5
+ 'constructor-super': 'error',
6
+ 'for-direction': 'error',
7
+ 'getter-return': 'error',
8
+ 'no-async-promise-executor': 'error',
9
+ 'no-case-declarations': 'error',
10
+ 'no-class-assign': 'error',
11
+ 'no-compare-neg-zero': 'error',
12
+ 'no-cond-assign': 'error',
13
+ 'no-const-assign': 'error',
14
+ 'no-constant-binary-expression': 'error',
15
+ 'no-constant-condition': 'error',
16
+ 'no-control-regex': 'error',
17
+ 'no-debugger': 'error',
18
+ 'no-delete-var': 'error',
19
+ 'no-dupe-args': 'error',
20
+ 'no-dupe-class-members': 'error',
21
+ 'no-dupe-else-if': 'error',
22
+ 'no-dupe-keys': 'error',
23
+ 'no-duplicate-case': 'error',
24
+ 'no-empty': 'error',
25
+ 'no-empty-character-class': 'error',
26
+ 'no-empty-pattern': 'error',
27
+ 'no-empty-static-block': 'error',
28
+ 'no-ex-assign': 'error',
29
+ 'no-extra-boolean-cast': 'error',
30
+ 'no-fallthrough': 'error',
31
+ 'no-func-assign': 'error',
32
+ 'no-global-assign': 'error',
33
+ 'no-import-assign': 'error',
34
+ 'no-invalid-regexp': 'error',
35
+ 'no-irregular-whitespace': 'error',
36
+ 'no-loss-of-precision': 'error',
37
+ 'no-misleading-character-class': 'error',
38
+ 'no-new-native-nonconstructor': 'error',
39
+ 'no-nonoctal-decimal-escape': 'error',
40
+ 'no-obj-calls': 'error',
41
+ 'no-octal': 'error',
42
+ 'no-prototype-builtins': 'error',
43
+ 'no-redeclare': 'error',
44
+ 'no-regex-spaces': 'error',
45
+ 'no-self-assign': 'error',
46
+ 'no-setter-return': 'error',
47
+ 'no-shadow-restricted-names': 'error',
48
+ 'no-sparse-arrays': 'error',
49
+ 'no-this-before-super': 'error',
50
+ 'no-undef': 'error',
51
+ 'no-unexpected-multiline': 'error',
52
+ 'no-unreachable': 'error',
53
+ 'no-unsafe-finally': 'error',
54
+ 'no-unsafe-negation': 'error',
55
+ 'no-unsafe-optional-chaining': 'error',
56
+ 'no-unused-labels': 'error',
57
+ 'no-unused-private-class-members': 'error',
58
+ 'no-unused-vars': 'error',
59
+ 'no-useless-backreference': 'error',
60
+ 'no-useless-catch': 'error',
61
+ 'no-useless-escape': 'error',
62
+ 'no-with': 'error',
63
+ 'require-yield': 'error',
64
+ 'use-isnan': 'error',
65
+ 'valid-typeof': 'error',
66
+
67
+ // Overrides
68
+ 'no-console': 'off',
69
+ 'sort-imports': 'off',
70
+ 'keyword-spacing': 'warn',
71
+ 'eqeqeq': ['warn', 'always'],
72
+
73
+ // Import
74
+ 'import/no-cycle': ['warn', { maxDepth: 30, ignoreExternal: false }],
75
+ },
76
+ };
@@ -0,0 +1,6 @@
1
+
2
+
3
+ export default {
4
+ plugins: [],
5
+ rules: {}
6
+ };
@@ -0,0 +1,11 @@
1
+
2
+
3
+ export default {
4
+ plugins: ['import'],
5
+ rules: {
6
+ "import/extensions": [
7
+ "error",
8
+ "always"
9
+ ]
10
+ }
11
+ }
@@ -0,0 +1,62 @@
1
+ export default {
2
+ plugins: [
3
+ 'typescript'
4
+ ],
5
+ rules: {
6
+ // Recommended
7
+ '@typescript-eslint/ban-ts-comment': 'error',
8
+ 'no-array-constructor': 'off',
9
+ '@typescript-eslint/no-array-constructor': 'error',
10
+ '@typescript-eslint/no-duplicate-enum-values': 'error',
11
+ '@typescript-eslint/no-empty-object-type': 'error',
12
+ '@typescript-eslint/no-explicit-any': 'error',
13
+ '@typescript-eslint/no-extra-non-null-assertion': 'error',
14
+ '@typescript-eslint/no-misused-new': 'error',
15
+ '@typescript-eslint/no-namespace': 'error',
16
+ '@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
17
+ '@typescript-eslint/no-require-imports': 'error',
18
+ '@typescript-eslint/no-this-alias': 'error',
19
+ '@typescript-eslint/no-unnecessary-type-constraint': 'error',
20
+ '@typescript-eslint/no-unsafe-declaration-merging': 'error',
21
+ '@typescript-eslint/no-unsafe-function-type': 'error',
22
+ 'no-unused-expressions': 'off',
23
+ '@typescript-eslint/no-unused-expressions': 'error',
24
+ 'no-unused-vars': 'off',
25
+ '@typescript-eslint/no-unused-vars': 'error',
26
+ '@typescript-eslint/no-wrapper-object-types': 'error',
27
+ '@typescript-eslint/prefer-as-const': 'error',
28
+ '@typescript-eslint/prefer-namespace-keyword': 'error',
29
+ '@typescript-eslint/triple-slash-reference': 'error',
30
+
31
+ // Overrides
32
+ "no-undef": "off", // Does not work with TypeScript
33
+
34
+ "@typescript-eslint/explicit-function-return-type": "off",
35
+ "@typescript-eslint/no-explicit-any": "off",
36
+
37
+ "no-unused-vars": "off",
38
+ "@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_", "caughtErrors": "none", }],
39
+
40
+ "prefer-promise-reject-errors": "off",
41
+ "@typescript-eslint/prefer-promise-reject-errors": "off", // Does not work correctly when passing on 'any' errors in a try catch block using reject()
42
+
43
+ "@typescript-eslint/no-namespace": "off",
44
+ "@typescript-eslint/no-floating-promises": "error",
45
+ "@typescript-eslint/no-misused-promises": "error",
46
+ "@typescript-eslint/prefer-for-of": "warn",
47
+ "@typescript-eslint/no-empty-interface": "off", // It is convenient to have placeholder interfaces
48
+ "@typescript-eslint/no-this-alias": "off", // No idea why we need this. This breaks code that is just fine. Prohibit the use of function() instead of this rule
49
+ "@typescript-eslint/unbound-method": "off", // Methods are automatically bound in vue, it would break removeEventListeners if we bound it every time unless we save every method in variables again...
50
+ "@typescript-eslint/no-unnecessary-type-assertion": "off", // There is a bug in the autofix that breaks Vue code (it changes code on the wrong position)
51
+ "@typescript-eslint/explicit-module-boundary-types": "off", // Don't need this, since we don't export methods, and is annoying for async methods without return values
52
+
53
+ "@typescript-eslint/no-unsafe-assignment": "off", // This is impossible to use with dependencies that don't have types yet, such as tiptap
54
+ "@typescript-eslint/no-unsafe-return": "off", // This is impossible to use with dependencies that don't have types yet, such as tiptap
55
+ "@typescript-eslint/no-unsafe-call": "off", // This is impossible to use with dependencies that don't have types yet, such as tiptap
56
+ "@typescript-eslint/no-unsafe-member-access": "off", // This is impossible to use with dependencies that don't have types yet, such as tiptap
57
+ "@typescript-eslint/restrict-plus-operands": "off", // bullshit one
58
+ "@typescript-eslint/require-await": "off", // You should be able to define async methods if you need to match required interfaces or types
59
+
60
+ "@typescript-eslint/no-redundant-type-constituents": "off", // Weird behaviour and reduces code readability
61
+ "@typescript-eslint/ban-ts-comment": "off",
62
+ }
package/src/index.js ADDED
@@ -0,0 +1,54 @@
1
+ 'use strict';
2
+
3
+ // Configs
4
+ import frontend from './configs/frontend.js';
5
+ import node from './configs/node.js';
6
+ import baseRules from './configs/default.js';
7
+
8
+ function merge(...a) {
9
+ if (a.length === 0) {
10
+ return {
11
+ plugins: [],
12
+ rules: {},
13
+ }
14
+ }
15
+ if (a.length === 1) {
16
+ return a;
17
+ }
18
+ if (a.length === 2) {
19
+ return mergeTwo(a[0], a[1]);
20
+ }
21
+ return merge(mergeTwo(a[0], a[1]), ...a.slice(2));
22
+ }
23
+
24
+ function mergeTwo(a, b) {
25
+ return {
26
+ plugins: [...new Set([...a.plugins, ...b.plugins]).values()],
27
+ rules: {
28
+ ...a.rules,
29
+ ...b.rules
30
+ },
31
+ overrides: [
32
+ ...(a.overrides ?? []),
33
+ ...(b.overrides ?? [])
34
+ ]
35
+ }
36
+ }
37
+
38
+ export default {
39
+ configs: {
40
+ base: baseRules,
41
+ frontend: merge(
42
+ baseRules,
43
+ frontend
44
+ ),
45
+ backend: merge(
46
+ baseRules,
47
+ node
48
+ ),
49
+ shared: merge(
50
+ baseRules,
51
+ node
52
+ )
53
+ },
54
+ };