@fullstacksjs/eslint-config 8.13.0 → 9.0.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/base.js +213 -25
- package/cypress.js +17 -2
- package/{rules/fp.js → fp.js} +2 -0
- package/graphql.js +67 -1
- package/{rules/import.js → import.js} +11 -0
- package/index.js +10 -4
- package/init.js +57 -0
- package/jest.js +67 -2
- package/{rules/naming-convention.js → naming-convention.js} +0 -0
- package/{rules/node.js → node.js} +2 -0
- package/package.json +12 -12
- package/{rules/promise.js → promise.js} +2 -0
- package/react.js +129 -1
- package/registerOpts.js +16 -0
- package/storybook.js +17 -1
- package/strict.js +15 -0
- package/{rules/test.js → test.js} +12 -7
- package/typecheck.js +65 -1
- package/typescript.js +77 -13
- package/utils.js +20 -0
- package/nextjs.js +0 -31
- package/packages.js +0 -9
- package/rules/base.js +0 -87
- package/rules/cypress.js +0 -16
- package/rules/es2015.js +0 -30
- package/rules/forbidden.js +0 -39
- package/rules/graphql.js +0 -70
- package/rules/jest.js +0 -65
- package/rules/jsx-a11y.js +0 -40
- package/rules/react-hooks.js +0 -6
- package/rules/react.js +0 -92
- package/rules/storybook.js +0 -19
- package/rules/strict.js +0 -66
- package/rules/style.js +0 -61
- package/rules/typecheck.js +0 -67
- package/rules/typescript.js +0 -162
- package/rules/variables.js +0 -23
package/rules/graphql.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/** @type { import('eslint').Linter.Config } */
|
|
2
|
-
module.exports = {
|
|
3
|
-
rules: {
|
|
4
|
-
'@graphql-eslint/alphabetize': ['warn', { fields: ['ObjectTypeDefinition'] }],
|
|
5
|
-
'@graphql-eslint/description-style': 'warn',
|
|
6
|
-
'@graphql-eslint/executable-definitions': 'off',
|
|
7
|
-
'@graphql-eslint/fields-on-correct-type': 'warn',
|
|
8
|
-
'@graphql-eslint/fragments-on-composite-type': 'warn',
|
|
9
|
-
'@graphql-eslint/input-name': 'warn',
|
|
10
|
-
'@graphql-eslint/known-argument-names': 'warn',
|
|
11
|
-
'@graphql-eslint/known-directives': 'warn',
|
|
12
|
-
'@graphql-eslint/known-fragment-names': 'warn',
|
|
13
|
-
'@graphql-eslint/known-type-names': 'warn',
|
|
14
|
-
'@graphql-eslint/lone-anonymous-operation': 'warn',
|
|
15
|
-
'@graphql-eslint/lone-executable-definition': 'off',
|
|
16
|
-
'@graphql-eslint/lone-schema-definition': 'warn',
|
|
17
|
-
'@graphql-eslint/match-document-filename': ['warn', { query: 'camelCase', mutation: 'camelCase', subscription: 'camelCase' }],
|
|
18
|
-
'@graphql-eslint/naming-convention': 'warn',
|
|
19
|
-
'@graphql-eslint/no-anonymous-operations': 'warn',
|
|
20
|
-
'@graphql-eslint/no-case-insensitive-enum-values-duplicates': 'warn',
|
|
21
|
-
'@graphql-eslint/no-deprecated': 'warn',
|
|
22
|
-
'@graphql-eslint/no-duplicate-fields': 'warn',
|
|
23
|
-
'@graphql-eslint/no-fragment-cycles': 'warn',
|
|
24
|
-
'@graphql-eslint/no-hashtag-description': 'warn',
|
|
25
|
-
'@graphql-eslint/no-one-place-fragments': 'off',
|
|
26
|
-
'@graphql-eslint/no-root-type': 'off',
|
|
27
|
-
'@graphql-eslint/no-scalar-result-type-on-mutation': 'warn',
|
|
28
|
-
'@graphql-eslint/no-typename-prefix': 'warn',
|
|
29
|
-
'@graphql-eslint/no-undefined-variables': 'warn',
|
|
30
|
-
'@graphql-eslint/no-unreachable-types': 'warn',
|
|
31
|
-
'@graphql-eslint/no-unused-fields': 'warn',
|
|
32
|
-
'@graphql-eslint/no-unused-fragments': 'warn',
|
|
33
|
-
'@graphql-eslint/no-unused-variables': 'warn',
|
|
34
|
-
'@graphql-eslint/one-field-subscriptions': 'warn',
|
|
35
|
-
'@graphql-eslint/overlapping-fields-can-be-merged': 'warn',
|
|
36
|
-
'@graphql-eslint/possible-fragment-spread': 'warn',
|
|
37
|
-
'@graphql-eslint/possible-type-extension': 'warn',
|
|
38
|
-
'@graphql-eslint/provided-required-arguments': 'warn',
|
|
39
|
-
'@graphql-eslint/relay-arguments': 'warn',
|
|
40
|
-
'@graphql-eslint/relay-connection-types': 'warn',
|
|
41
|
-
'@graphql-eslint/relay-edge-types': 'warn',
|
|
42
|
-
'@graphql-eslint/relay-page-info': 'warn',
|
|
43
|
-
'@graphql-eslint/require-deprecation-date': 'warn',
|
|
44
|
-
'@graphql-eslint/require-deprecation-reason': 'warn',
|
|
45
|
-
'@graphql-eslint/require-description': 'off',
|
|
46
|
-
'@graphql-eslint/require-field-of-type-query-in-mutation-result': 'warn',
|
|
47
|
-
'@graphql-eslint/require-id-when-available': 'warn',
|
|
48
|
-
'@graphql-eslint/require-nullable-fields-with-oneof': 'warn',
|
|
49
|
-
'@graphql-eslint/require-type-pattern-with-oneof': 'warn',
|
|
50
|
-
'@graphql-eslint/scalar-leafs': 'warn',
|
|
51
|
-
'@graphql-eslint/selection-set-depth': 'off',
|
|
52
|
-
'@graphql-eslint/strict-id-in-types': 'warn',
|
|
53
|
-
'@graphql-eslint/unique-argument-names': 'warn',
|
|
54
|
-
'@graphql-eslint/unique-directive-names': 'warn',
|
|
55
|
-
'@graphql-eslint/unique-directive-names-per-location': 'warn',
|
|
56
|
-
'@graphql-eslint/unique-enum-value-names': 'warn',
|
|
57
|
-
'@graphql-eslint/unique-field-definition-names': 'warn',
|
|
58
|
-
'@graphql-eslint/unique-fragment-name': 'warn',
|
|
59
|
-
'@graphql-eslint/unique-input-field-names': 'warn',
|
|
60
|
-
'@graphql-eslint/unique-operation-name': 'warn',
|
|
61
|
-
'@graphql-eslint/unique-operation-types': 'warn',
|
|
62
|
-
'@graphql-eslint/unique-type-names': 'warn',
|
|
63
|
-
'@graphql-eslint/unique-variable-names': 'warn',
|
|
64
|
-
'@graphql-eslint/value-literals-of-correct-type': 'warn',
|
|
65
|
-
'@graphql-eslint/variables-are-input-types': 'warn',
|
|
66
|
-
'@graphql-eslint/variables-in-allowed-position': 'warn',
|
|
67
|
-
|
|
68
|
-
'spaced-comment': 'off',
|
|
69
|
-
},
|
|
70
|
-
};
|
package/rules/jest.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
const packages = require('../packages');
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
rules: {
|
|
5
|
-
'jest/consistent-test-it': 'off',
|
|
6
|
-
'jest/expect-expect': 'off',
|
|
7
|
-
'jest/lowercase-name': 'off',
|
|
8
|
-
'jest/max-nested-describe': ['error', { max: 2 }],
|
|
9
|
-
'jest/no-alias-methods': 'error',
|
|
10
|
-
'jest/no-commented-out-tests': 'warn',
|
|
11
|
-
'jest/no-conditional-expect': 'error',
|
|
12
|
-
'jest/no-conditional-in-test': 'error',
|
|
13
|
-
'jest/no-done-callback': 'warn',
|
|
14
|
-
'jest/no-expect-resolves': 'off',
|
|
15
|
-
'jest/no-export': 'error',
|
|
16
|
-
'jest/no-hooks': 'off',
|
|
17
|
-
'jest/no-interpolation-in-snapshots': 'error',
|
|
18
|
-
'jest/no-jasmine-globals': 'off',
|
|
19
|
-
'jest/no-large-snapshots': ['warn', { maxSize: 300 }],
|
|
20
|
-
'jest/no-mocks-import': 'error',
|
|
21
|
-
'jest/no-restricted-jest-methods': 'off',
|
|
22
|
-
'jest/no-restricted-matchers': 'error',
|
|
23
|
-
'jest/no-standalone-expect': 'off',
|
|
24
|
-
'jest/no-test-callback': 'off',
|
|
25
|
-
'jest/no-test-prefixes': 'error',
|
|
26
|
-
'jest/no-test-return-statement': 'off',
|
|
27
|
-
'jest/no-truthy-falsy': 'off',
|
|
28
|
-
'jest/prefer-called-with': 'error',
|
|
29
|
-
'jest/prefer-each': 'warn',
|
|
30
|
-
'jest/prefer-expect-assertions': 'off',
|
|
31
|
-
'jest/prefer-expect-resolves': 'warn',
|
|
32
|
-
'jest/prefer-hooks-on-top': 'error',
|
|
33
|
-
'jest/prefer-inline-snapshots': 'off',
|
|
34
|
-
'jest/prefer-mock-promise-shorthand': 'warn',
|
|
35
|
-
'jest/prefer-lowercase-title': 'off',
|
|
36
|
-
'jest/prefer-snapshot-hint': 'warn',
|
|
37
|
-
'jest/prefer-spy-on': 'off',
|
|
38
|
-
'jest/prefer-strict-equal': 'off',
|
|
39
|
-
'jest/prefer-to-be-null': 'off',
|
|
40
|
-
'jest/prefer-to-be-undefined': 'off',
|
|
41
|
-
'jest/prefer-to-be': 'warn',
|
|
42
|
-
'jest/prefer-to-contain': 'warn',
|
|
43
|
-
'jest/prefer-to-have-length': 'warn',
|
|
44
|
-
'jest/prefer-todo': 'warn',
|
|
45
|
-
'jest/require-hook': 'off',
|
|
46
|
-
'jest/require-to-throw-message': 'off',
|
|
47
|
-
'jest/require-top-level-describe': 'off',
|
|
48
|
-
'jest/valid-describe-callback': 'error',
|
|
49
|
-
'jest/valid-expect-in-promise': 'error',
|
|
50
|
-
'jest/valid-expect': 'error',
|
|
51
|
-
'jest/valid-title': 'warn',
|
|
52
|
-
|
|
53
|
-
'jest/no-deprecated-functions': 'off',
|
|
54
|
-
...packages.ifAnyDep('jest', () => ({
|
|
55
|
-
'jest/no-deprecated-functions': 'error',
|
|
56
|
-
})),
|
|
57
|
-
|
|
58
|
-
...packages.ifAnyDep('typescript', () => ({
|
|
59
|
-
'@typescript-eslint/unbound-method': 'off',
|
|
60
|
-
})),
|
|
61
|
-
|
|
62
|
-
// conflicts
|
|
63
|
-
'fp/no-let': 'off',
|
|
64
|
-
},
|
|
65
|
-
};
|
package/rules/jsx-a11y.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
rules: {
|
|
3
|
-
'jsx-a11y/alt-text': 'warn',
|
|
4
|
-
'jsx-a11y/anchor-has-content': 'error',
|
|
5
|
-
'jsx-a11y/anchor-is-valid': 'error',
|
|
6
|
-
'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
|
|
7
|
-
'jsx-a11y/aria-props': 'error',
|
|
8
|
-
'jsx-a11y/aria-proptypes': 'error',
|
|
9
|
-
'jsx-a11y/aria-role': 'error',
|
|
10
|
-
'jsx-a11y/aria-unsupported-elements': 'error',
|
|
11
|
-
'jsx-a11y/autocomplete-valid': 'off',
|
|
12
|
-
'jsx-a11y/click-events-have-key-events': 'error',
|
|
13
|
-
'jsx-a11y/control-has-associated-label': 'off',
|
|
14
|
-
'jsx-a11y/heading-has-content': 'error',
|
|
15
|
-
'jsx-a11y/html-has-lang': 'error',
|
|
16
|
-
'jsx-a11y/iframe-has-title': 'error',
|
|
17
|
-
'jsx-a11y/img-redundant-alt': 'error',
|
|
18
|
-
'jsx-a11y/interactive-supports-focus': 'warn',
|
|
19
|
-
'jsx-a11y/label-has-associated-control': 'error',
|
|
20
|
-
'jsx-a11y/lang': 'error',
|
|
21
|
-
'jsx-a11y/media-has-caption': 'warn',
|
|
22
|
-
'jsx-a11y/mouse-events-have-key-events': 'error',
|
|
23
|
-
'jsx-a11y/no-access-key': 'error',
|
|
24
|
-
'jsx-a11y/no-aria-hidden-on-focusable': 'warn',
|
|
25
|
-
'jsx-a11y/no-autofocus': 'off',
|
|
26
|
-
'jsx-a11y/no-distracting-elements': 'error',
|
|
27
|
-
'jsx-a11y/no-interactive-element-to-noninteractive-role': 'warn',
|
|
28
|
-
'jsx-a11y/no-noninteractive-element-interactions': 'warn',
|
|
29
|
-
'jsx-a11y/no-noninteractive-element-to-interactive-role': 'warn',
|
|
30
|
-
'jsx-a11y/no-noninteractive-tabindex': 'off',
|
|
31
|
-
'jsx-a11y/no-redundant-roles': 'error',
|
|
32
|
-
'jsx-a11y/no-static-element-interactions': 'off',
|
|
33
|
-
'jsx-a11y/role-has-required-aria-props': 'error',
|
|
34
|
-
'jsx-a11y/role-supports-aria-props': 'error',
|
|
35
|
-
'jsx-a11y/scope': 'error',
|
|
36
|
-
'jsx-a11y/tabindex-no-positive': 'warn',
|
|
37
|
-
'jsx-a11y/anchor-ambiguous-text': 'off',
|
|
38
|
-
'jsx-a11y/prefer-tag-over-role': 'off',
|
|
39
|
-
},
|
|
40
|
-
};
|
package/rules/react-hooks.js
DELETED
package/rules/react.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
rules: {
|
|
3
|
-
'react/boolean-prop-naming': 'off',
|
|
4
|
-
'react/button-has-type': 'off',
|
|
5
|
-
'react/default-props-match-prop-types': 'off',
|
|
6
|
-
'react/destructuring-assignment': 'off',
|
|
7
|
-
'react/display-name': ['off', { ignoreTranspilerName: false }],
|
|
8
|
-
'react/forbid-component-props': 'off',
|
|
9
|
-
'react/forbid-dom-props': 'off',
|
|
10
|
-
'react/forbid-elements': 'off',
|
|
11
|
-
'react/forbid-foreign-prop-types': 'error',
|
|
12
|
-
'react/forbid-prop-types': 'off',
|
|
13
|
-
'react/function-component-definition': ['warn', { namedComponents: 'arrow-function', unnamedComponents: 'arrow-function' }],
|
|
14
|
-
'react/hook-use-state': 'off',
|
|
15
|
-
'react/iframe-missing-sandbox': 'error',
|
|
16
|
-
'react/jsx-boolean-value': 'warn',
|
|
17
|
-
'react/jsx-child-element-spacing': 'warn',
|
|
18
|
-
'react/jsx-curly-brace-presence': ['warn', { props: 'never', children: 'ignore' }],
|
|
19
|
-
'react/jsx-filename-extension': ['error', { extensions: ['.jsx', '.tsx'] }],
|
|
20
|
-
'react/jsx-fragments': 'off',
|
|
21
|
-
'react/jsx-handler-names': 'off',
|
|
22
|
-
'react/jsx-key': 'error',
|
|
23
|
-
'react/jsx-max-depth': 'off',
|
|
24
|
-
'react/jsx-newline': 'off',
|
|
25
|
-
'react/jsx-no-bind': 'off',
|
|
26
|
-
'react/jsx-no-comment-textnodes': 'error',
|
|
27
|
-
'react/jsx-no-constructed-context-values': 'error',
|
|
28
|
-
'react/jsx-no-duplicate-props': 'error',
|
|
29
|
-
'react/jsx-no-leaked-render': 'error',
|
|
30
|
-
'react/jsx-no-literals': 'off',
|
|
31
|
-
'react/jsx-no-script-url': 'error',
|
|
32
|
-
'react/jsx-no-target-blank': 'error',
|
|
33
|
-
'react/jsx-no-undef': 'error',
|
|
34
|
-
'react/jsx-no-useless-fragment': 'warn',
|
|
35
|
-
'react/jsx-one-expression-per-line': ['off', { allow: 'literal' }],
|
|
36
|
-
'react/jsx-pascal-case': 'error',
|
|
37
|
-
'react/jsx-props-no-multi-spaces': 'off',
|
|
38
|
-
'react/jsx-props-no-spreading': 'off',
|
|
39
|
-
'react/jsx-sort-default-props': 'off',
|
|
40
|
-
'react/jsx-sort-props': 'off',
|
|
41
|
-
'react/jsx-uses-react': 'error',
|
|
42
|
-
'react/jsx-uses-vars': 'error',
|
|
43
|
-
'react/no-access-state-in-setstate': 'error',
|
|
44
|
-
'react/no-adjacent-inline-elements': 'error',
|
|
45
|
-
'react/no-array-index-key': 'warn',
|
|
46
|
-
'react/no-arrow-function-lifecycle': 'error',
|
|
47
|
-
'react/no-children-prop': 'off',
|
|
48
|
-
'react/no-danger': 'off',
|
|
49
|
-
'react/no-danger-with-children': 'error',
|
|
50
|
-
'react/no-deprecated': 'error',
|
|
51
|
-
'react/no-did-mount-set-state': 'error',
|
|
52
|
-
'react/no-did-update-set-state': 'error',
|
|
53
|
-
'react/no-direct-mutation-state': 'error',
|
|
54
|
-
'react/no-find-dom-node': 'error',
|
|
55
|
-
'react/no-invalid-html-attribute': 'warn',
|
|
56
|
-
'react/no-is-mounted': 'error',
|
|
57
|
-
'react/no-multi-comp': 'off',
|
|
58
|
-
'react/no-namespace': 'error',
|
|
59
|
-
'react/no-object-type-as-default-prop': 'warn',
|
|
60
|
-
'react/no-redundant-should-component-update': 'error',
|
|
61
|
-
'react/no-render-return-value': 'error',
|
|
62
|
-
'react/no-set-state': 'off',
|
|
63
|
-
'react/no-string-refs': 'error',
|
|
64
|
-
'react/no-this-in-sfc': 'error',
|
|
65
|
-
'react/no-typos': 'error',
|
|
66
|
-
'react/no-unescaped-entities': 'warn',
|
|
67
|
-
'react/no-unknown-property': 'error',
|
|
68
|
-
'react/no-unsafe': 'warn',
|
|
69
|
-
'react/no-unstable-nested-components': ['error', { allowAsProps: true }],
|
|
70
|
-
'react/no-unused-class-component-methods': 'warn',
|
|
71
|
-
'react/no-unused-prop-types': 'error',
|
|
72
|
-
'react/no-unused-state': 'error',
|
|
73
|
-
'react/no-will-update-set-state': 'error',
|
|
74
|
-
'react/prefer-es6-class': 'off',
|
|
75
|
-
'react/prefer-exact-props': 'off',
|
|
76
|
-
'react/prefer-read-only-props': 'off',
|
|
77
|
-
'react/prefer-stateless-function': 'off',
|
|
78
|
-
'react/prop-types': 'off',
|
|
79
|
-
'react/react-in-jsx-scope': 'off', // jsx automatic runtime
|
|
80
|
-
'react/require-default-props': 'off',
|
|
81
|
-
'react/require-optimization': 'off',
|
|
82
|
-
'react/require-render-return': 'error',
|
|
83
|
-
'react/self-closing-comp': 'error',
|
|
84
|
-
'react/sort-comp': 'off',
|
|
85
|
-
'react/sort-default-props': 'warn',
|
|
86
|
-
'react/sort-prop-types': 'off',
|
|
87
|
-
'react/state-in-constructor': 'off',
|
|
88
|
-
'react/static-property-placement': 'off',
|
|
89
|
-
'react/style-prop-object': 'error',
|
|
90
|
-
'react/void-dom-elements-no-children': 'error',
|
|
91
|
-
},
|
|
92
|
-
};
|
package/rules/storybook.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
rules: {
|
|
3
|
-
'storybook/await-interactions': 'error',
|
|
4
|
-
'storybook/context-in-play-function': 'error',
|
|
5
|
-
'storybook/default-exports': 'error',
|
|
6
|
-
'storybook/hierarchy-separator': 'warn',
|
|
7
|
-
'storybook/no-redundant-story-name': 'warn',
|
|
8
|
-
'storybook/no-uninstalled-addons': 'error',
|
|
9
|
-
'storybook/prefer-pascal-case': 'warn',
|
|
10
|
-
'storybook/story-exports': 'error',
|
|
11
|
-
'storybook/use-storybook-expect': 'error',
|
|
12
|
-
'storybook/use-storybook-testing-library': 'error',
|
|
13
|
-
|
|
14
|
-
'storybook/csf-component': 'warn',
|
|
15
|
-
'storybook/no-stories-of': 'warn',
|
|
16
|
-
'storybook/no-title-property-in-meta': 'warn',
|
|
17
|
-
'storybook/meta-inline-properties': 'off',
|
|
18
|
-
},
|
|
19
|
-
};
|
package/rules/strict.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
rules: {
|
|
3
|
-
'no-console': 'warn',
|
|
4
|
-
'fp/no-delete': 'error',
|
|
5
|
-
'fp/no-get-set': 'error',
|
|
6
|
-
'fp/no-mutating-methods': 'error',
|
|
7
|
-
'fp/no-mutation': ['error', { commonjs: true, allowThis: true, exceptions: [{ property: 'propTypes' }, { property: 'defaultProps' }] }],
|
|
8
|
-
'fp/no-nil': 'error',
|
|
9
|
-
'fp/no-this': 'error',
|
|
10
|
-
'fp/no-throw': 'error',
|
|
11
|
-
'fp/no-unused-expression': ['error', { allowUseStrict: true }],
|
|
12
|
-
'@typescript-eslint/no-non-null-assertion': 'warn',
|
|
13
|
-
'@typescript-eslint/naming-convention': [
|
|
14
|
-
'warn',
|
|
15
|
-
{
|
|
16
|
-
selector: 'default',
|
|
17
|
-
format: ['camelCase'],
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
selector: 'function',
|
|
21
|
-
format: ['camelCase', 'PascalCase'],
|
|
22
|
-
},
|
|
23
|
-
// variables, CONSTANTS, ReactComponents
|
|
24
|
-
{
|
|
25
|
-
selector: 'variable',
|
|
26
|
-
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
selector: 'parameter',
|
|
30
|
-
format: ['camelCase', 'PascalCase'],
|
|
31
|
-
leadingUnderscore: 'allowSingleOrDouble',
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
selector: 'memberLike',
|
|
35
|
-
format: ['camelCase', 'PascalCase'],
|
|
36
|
-
leadingUnderscore: 'allow',
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
selector: 'memberLike',
|
|
40
|
-
modifiers: ['static'],
|
|
41
|
-
format: ['camelCase', 'PascalCase'],
|
|
42
|
-
leadingUnderscore: 'allow',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
selector: 'memberLike',
|
|
46
|
-
modifiers: ['private'],
|
|
47
|
-
format: ['camelCase'],
|
|
48
|
-
leadingUnderscore: 'allow',
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
selector: 'typeLike',
|
|
52
|
-
format: ['PascalCase'],
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
selector: 'enumMember',
|
|
56
|
-
format: ['PascalCase'],
|
|
57
|
-
},
|
|
58
|
-
// disallow I prefix for interfaces
|
|
59
|
-
{
|
|
60
|
-
selector: 'interface',
|
|
61
|
-
format: ['PascalCase'],
|
|
62
|
-
custom: { regex: '^I[A-Z]', match: false },
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
},
|
|
66
|
-
};
|
package/rules/style.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
rules: {
|
|
3
|
-
'arrow-body-style': ['off', 'as-needed'], // Annoying
|
|
4
|
-
'brace-style': 'off', // prettier
|
|
5
|
-
'camelcase': ['warn', { properties: 'always' }],
|
|
6
|
-
'capitalized-comments': 'off',
|
|
7
|
-
'comma-spacing': ['warn', { after: true, before: false }],
|
|
8
|
-
'consistent-this': 'off',
|
|
9
|
-
'func-name-matching': 'error',
|
|
10
|
-
'func-names': 'error',
|
|
11
|
-
'func-style': 'off',
|
|
12
|
-
'id-denylist': 'off',
|
|
13
|
-
'init-declarations': 'off',
|
|
14
|
-
'id-length': 'off',
|
|
15
|
-
'id-match': [
|
|
16
|
-
'error',
|
|
17
|
-
// __filename, camelCase, PascalCase, CONST_VALUE, stream$, $el
|
|
18
|
-
'^\\$?(__)?(([A-Z]|[a-z]|[0-9]+)|([A-Z_]))*\\$?$',
|
|
19
|
-
],
|
|
20
|
-
'line-comment-position': 'off',
|
|
21
|
-
'linebreak-style': ['error', 'unix'],
|
|
22
|
-
'lines-around-comment': 'off',
|
|
23
|
-
'lines-between-class-members': ['warn', 'always', { exceptAfterSingleLine: false }],
|
|
24
|
-
'logical-assignment-operators': 'off',
|
|
25
|
-
'max-classes-per-file': 'off',
|
|
26
|
-
'max-depth': ['error', 4],
|
|
27
|
-
'max-lines-per-function': ['error', 150],
|
|
28
|
-
'max-lines': ['error', { max: 2500, skipBlankLines: false, skipComments: false }],
|
|
29
|
-
'max-nested-callbacks': ['error', 7],
|
|
30
|
-
'max-params': ['error', 7],
|
|
31
|
-
'max-statements-per-line': ['error', { max: 1 }],
|
|
32
|
-
'max-statements': ['error', 40],
|
|
33
|
-
'multiline-comment-style': 'off',
|
|
34
|
-
'new-cap': 'off',
|
|
35
|
-
'no-array-constructor': 'error',
|
|
36
|
-
'no-bitwise': 'error',
|
|
37
|
-
'no-continue': 'off',
|
|
38
|
-
'no-inline-comments': 'off',
|
|
39
|
-
'no-lonely-if': 'error',
|
|
40
|
-
'no-multi-assign': 'error',
|
|
41
|
-
'no-negated-condition': 'off',
|
|
42
|
-
'no-nested-ternary': 'off',
|
|
43
|
-
'no-new-object': 'error',
|
|
44
|
-
'no-plusplus': 'off',
|
|
45
|
-
'no-promise-executor-return': 'error',
|
|
46
|
-
'no-ternary': 'off',
|
|
47
|
-
'no-underscore-dangle': 'off',
|
|
48
|
-
'no-unneeded-ternary': 'error',
|
|
49
|
-
'object-shorthand': ['error', 'properties'],
|
|
50
|
-
'one-var': ['error', { uninitialized: 'never', initialized: 'never' }],
|
|
51
|
-
'operator-assignment': 'off',
|
|
52
|
-
'padding-line-between-statements': 'off',
|
|
53
|
-
'prefer-arrow-callback': ['warn', { allowNamedFunctions: true, allowUnboundThis: true }],
|
|
54
|
-
'prefer-destructuring': 'off',
|
|
55
|
-
'prefer-object-spread': 'warn',
|
|
56
|
-
'sort-keys': 'off',
|
|
57
|
-
'sort-vars': 'off',
|
|
58
|
-
'spaced-comment': ['warn', 'always', { markers: ['/'] }], // ignore typescript triple-slash
|
|
59
|
-
'prettier/prettier': 'error',
|
|
60
|
-
},
|
|
61
|
-
};
|
package/rules/typecheck.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
rules: {
|
|
3
|
-
'@typescript-eslint/await-thenable': 'error',
|
|
4
|
-
'@typescript-eslint/consistent-type-exports': 'warn',
|
|
5
|
-
'@typescript-eslint/dot-notation': [
|
|
6
|
-
'warn',
|
|
7
|
-
{
|
|
8
|
-
allowPrivateClassPropertyAccess: false,
|
|
9
|
-
allowProtectedClassPropertyAccess: false,
|
|
10
|
-
allowIndexSignaturePropertyAccess: true,
|
|
11
|
-
},
|
|
12
|
-
],
|
|
13
|
-
'@typescript-eslint/no-confusing-void-expression': ['warn', { ignoreArrowShorthand: true, ignoreVoidOperator: true }],
|
|
14
|
-
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
|
|
15
|
-
'@typescript-eslint/no-for-in-array': 'error',
|
|
16
|
-
'@typescript-eslint/no-implied-eval': 'error',
|
|
17
|
-
'@typescript-eslint/no-meaningless-void-operator': ['warn', { checkNever: false }],
|
|
18
|
-
'@typescript-eslint/no-misused-promises': ['warn', { checksVoidReturn: { attributes: false } }],
|
|
19
|
-
'@typescript-eslint/no-redundant-type-constituents': 'warn',
|
|
20
|
-
'@typescript-eslint/no-throw-literal': 'error',
|
|
21
|
-
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
|
|
22
|
-
'@typescript-eslint/no-unnecessary-condition': [
|
|
23
|
-
'warn',
|
|
24
|
-
{
|
|
25
|
-
allowConstantLoopConditions: false,
|
|
26
|
-
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
'@typescript-eslint/no-unnecessary-qualifier': 'error',
|
|
30
|
-
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
|
|
31
|
-
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
|
|
32
|
-
'@typescript-eslint/non-nullable-type-assertion-style': 'warn',
|
|
33
|
-
'@typescript-eslint/prefer-includes': 'warn',
|
|
34
|
-
'@typescript-eslint/prefer-reduce-type-parameter': 'warn',
|
|
35
|
-
'@typescript-eslint/prefer-nullish-coalescing': [
|
|
36
|
-
'warn',
|
|
37
|
-
{
|
|
38
|
-
ignoreConditionalTests: false,
|
|
39
|
-
ignoreTernaryTests: false,
|
|
40
|
-
ignoreMixedLogicalExpressions: false,
|
|
41
|
-
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
'@typescript-eslint/prefer-regexp-exec': 'warn',
|
|
45
|
-
'@typescript-eslint/prefer-return-this-type': 'warn',
|
|
46
|
-
'@typescript-eslint/prefer-string-starts-ends-with': 'warn',
|
|
47
|
-
'@typescript-eslint/require-array-sort-compare': 'error',
|
|
48
|
-
'@typescript-eslint/require-await': 'error',
|
|
49
|
-
'@typescript-eslint/return-await': 'error',
|
|
50
|
-
'@typescript-eslint/switch-exhaustiveness-check': 'error',
|
|
51
|
-
'@typescript-eslint/unbound-method': ['error', { ignoreStatic: true }],
|
|
52
|
-
'@typescript-eslint/naming-convention': [
|
|
53
|
-
'warn',
|
|
54
|
-
...require('./naming-convention'), // eslint-disable-line node/global-require
|
|
55
|
-
// force use is/should/has for boolean variables
|
|
56
|
-
{
|
|
57
|
-
selector: 'variable',
|
|
58
|
-
types: ['boolean'],
|
|
59
|
-
format: ['PascalCase'],
|
|
60
|
-
prefix: ['is', 'should', 'has', 'can', 'did', 'will', 'enable', 'loading'],
|
|
61
|
-
},
|
|
62
|
-
],
|
|
63
|
-
|
|
64
|
-
// collisions
|
|
65
|
-
'dot-notation': 'off',
|
|
66
|
-
},
|
|
67
|
-
};
|