@oriflame/config-eslint 4.3.0 → 5.0.3

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.
Files changed (120) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +2 -81
  3. package/dts/index.d.ts +10 -0
  4. package/lib/index.js +45 -40
  5. package/lib/index.js.map +1 -0
  6. package/package.json +37 -30
  7. package/src/index.ts +21 -27
  8. package/CHANGELOG.md +0 -3617
  9. package/lib/index.d.ts +0 -10
  10. package/lib/index.d.ts.map +0 -1
  11. package/lib/presets/SECRET_CONFIG_DO_NOT_USE_THIS.d.ts +0 -4
  12. package/lib/presets/SECRET_CONFIG_DO_NOT_USE_THIS.d.ts.map +0 -1
  13. package/lib/presets/SECRET_CONFIG_DO_NOT_USE_THIS.js +0 -32
  14. package/lib/presets/base.d.ts +0 -4
  15. package/lib/presets/base.d.ts.map +0 -1
  16. package/lib/presets/base.js +0 -120
  17. package/lib/presets/future.d.ts +0 -4
  18. package/lib/presets/future.d.ts.map +0 -1
  19. package/lib/presets/future.js +0 -13
  20. package/lib/presets/nextjs.d.ts +0 -4
  21. package/lib/presets/nextjs.d.ts.map +0 -1
  22. package/lib/presets/nextjs.js +0 -13
  23. package/lib/presets/node.d.ts +0 -4
  24. package/lib/presets/node.d.ts.map +0 -1
  25. package/lib/presets/node.js +0 -26
  26. package/lib/presets/prettier.d.ts +0 -4
  27. package/lib/presets/prettier.d.ts.map +0 -1
  28. package/lib/presets/prettier.js +0 -13
  29. package/lib/presets/typescript.d.ts +0 -4
  30. package/lib/presets/typescript.d.ts.map +0 -1
  31. package/lib/presets/typescript.js +0 -40
  32. package/lib/resolvers/graphql.d.ts +0 -6
  33. package/lib/resolvers/graphql.d.ts.map +0 -1
  34. package/lib/resolvers/graphql.js +0 -12
  35. package/lib/rules/a11y.d.ts +0 -4
  36. package/lib/rules/a11y.d.ts.map +0 -1
  37. package/lib/rules/a11y.js +0 -45
  38. package/lib/rules/eslint-comments.d.ts +0 -4
  39. package/lib/rules/eslint-comments.d.ts.map +0 -1
  40. package/lib/rules/eslint-comments.js +0 -14
  41. package/lib/rules/eslint.d.ts +0 -4
  42. package/lib/rules/eslint.d.ts.map +0 -1
  43. package/lib/rules/eslint.js +0 -385
  44. package/lib/rules/import.d.ts +0 -4
  45. package/lib/rules/import.d.ts.map +0 -1
  46. package/lib/rules/import.js +0 -76
  47. package/lib/rules/jest.d.ts +0 -4
  48. package/lib/rules/jest.d.ts.map +0 -1
  49. package/lib/rules/jest.js +0 -59
  50. package/lib/rules/nextjs.d.ts +0 -4
  51. package/lib/rules/nextjs.d.ts.map +0 -1
  52. package/lib/rules/nextjs.js +0 -17
  53. package/lib/rules/node.d.ts +0 -4
  54. package/lib/rules/node.d.ts.map +0 -1
  55. package/lib/rules/node.js +0 -45
  56. package/lib/rules/prettier.d.ts +0 -4
  57. package/lib/rules/prettier.d.ts.map +0 -1
  58. package/lib/rules/prettier.js +0 -6
  59. package/lib/rules/promise.d.ts +0 -4
  60. package/lib/rules/promise.d.ts.map +0 -1
  61. package/lib/rules/promise.js +0 -24
  62. package/lib/rules/react-hooks.d.ts +0 -4
  63. package/lib/rules/react-hooks.d.ts.map +0 -1
  64. package/lib/rules/react-hooks.js +0 -7
  65. package/lib/rules/react.d.ts +0 -4
  66. package/lib/rules/react.d.ts.map +0 -1
  67. package/lib/rules/react.js +0 -143
  68. package/lib/rules/testing-library.d.ts +0 -4
  69. package/lib/rules/testing-library.d.ts.map +0 -1
  70. package/lib/rules/testing-library.js +0 -31
  71. package/lib/rules/typescript.d.ts +0 -4
  72. package/lib/rules/typescript.d.ts.map +0 -1
  73. package/lib/rules/typescript.js +0 -369
  74. package/lib/rules/unicorn.d.ts +0 -4
  75. package/lib/rules/unicorn.d.ts.map +0 -1
  76. package/lib/rules/unicorn.js +0 -105
  77. package/src/presets/SECRET_CONFIG_DO_NOT_USE_THIS.ts +0 -34
  78. package/src/presets/base.ts +0 -143
  79. package/src/presets/future.ts +0 -13
  80. package/src/presets/nextjs.ts +0 -13
  81. package/src/presets/node.ts +0 -27
  82. package/src/presets/prettier.ts +0 -13
  83. package/src/presets/typescript.ts +0 -45
  84. package/src/resolvers/graphql.ts +0 -11
  85. package/src/rules/a11y.ts +0 -47
  86. package/src/rules/eslint-comments.ts +0 -16
  87. package/src/rules/eslint.ts +0 -384
  88. package/src/rules/import.ts +0 -79
  89. package/src/rules/jest.ts +0 -64
  90. package/src/rules/nextjs.ts +0 -19
  91. package/src/rules/node.ts +0 -47
  92. package/src/rules/prettier.ts +0 -8
  93. package/src/rules/promise.ts +0 -26
  94. package/src/rules/react-hooks.ts +0 -9
  95. package/src/rules/react.ts +0 -145
  96. package/src/rules/testing-library.ts +0 -33
  97. package/src/rules/typescript.ts +0 -377
  98. package/src/rules/unicorn.ts +0 -108
  99. package/test/index.test.ts +0 -81
  100. package/test/lint-files/combo.ts +0 -10
  101. package/test/lint-files/errors/combo.ts +0 -3
  102. package/test/lint-files/errors/javascript.js +0 -2
  103. package/test/lint-files/errors/next.js +0 -11
  104. package/test/lint-files/errors/node.js +0 -3
  105. package/test/lint-files/errors/prettier.js +0 -5
  106. package/test/lint-files/errors/test.js +0 -3
  107. package/test/lint-files/errors/typescript.ts +0 -3
  108. package/test/lint-files/javascript.js +0 -1
  109. package/test/lint-files/next.js +0 -5
  110. package/test/lint-files/node.js +0 -2
  111. package/test/lint-files/prettier.js +0 -1
  112. package/test/lint-files/test.js +0 -5
  113. package/test/lint-files/typescript.ts +0 -20
  114. package/test/tsconfig.json +0 -19
  115. package/test/utils/getErrors.ts +0 -16
  116. package/tools/check-rules/allRules.ts +0 -99
  117. package/tools/check-rules/index.ts +0 -90
  118. package/tools/check-rules/tsconfig.json +0 -17
  119. package/tsconfig.json +0 -22
  120. package/tsconfig.tsbuildinfo +0 -1
@@ -1,105 +0,0 @@
1
- "use strict";
2
- const config = {
3
- // override ESLint rules
4
- 'no-nested-ternary': 'off',
5
- 'no-warning-comments': 'off',
6
- // eslint-plugin-unicorn rules
7
- 'unicorn/better-regex': 'warn',
8
- 'unicorn/catch-error-name': 'warn',
9
- 'unicorn/consistent-destructuring': 'error',
10
- 'unicorn/consistent-function-scoping': 'error',
11
- 'unicorn/custom-error-definition': 'error',
12
- 'unicorn/empty-brace-spaces': 'off',
13
- 'unicorn/error-message': 'error',
14
- 'unicorn/escape-case': 'warn',
15
- 'unicorn/expiring-todo-comments': [
16
- 'warn',
17
- {
18
- terms: ['todo:', 'fixme:', 'debug:'],
19
- },
20
- ],
21
- 'unicorn/explicit-length-check': 'off',
22
- 'unicorn/filename-case': 'off',
23
- 'unicorn/import-index': 'error',
24
- 'unicorn/import-style': 'warn',
25
- 'unicorn/new-for-builtins': 'warn',
26
- 'unicorn/no-abusive-eslint-disable': 'off',
27
- 'unicorn/no-array-callback-reference': 'off',
28
- 'unicorn/no-array-for-each': 'off',
29
- 'unicorn/no-array-method-this-argument': 'error',
30
- 'unicorn/no-array-push-push': 'error',
31
- 'unicorn/no-array-reduce': 'off',
32
- 'unicorn/no-console-spaces': 'off',
33
- 'unicorn/no-document-cookie': 'error',
34
- 'unicorn/no-for-loop': 'warn',
35
- 'unicorn/no-hex-escape': 'warn',
36
- 'unicorn/no-instanceof-array': 'error',
37
- 'unicorn/no-keyword-prefix': 'off',
38
- 'unicorn/no-lonely-if': 'warn',
39
- 'unicorn/no-nested-ternary': 'error',
40
- 'unicorn/no-new-array': 'error',
41
- 'unicorn/no-new-buffer': 'error',
42
- 'unicorn/no-null': 'off',
43
- 'unicorn/no-object-as-default-parameter': 'error',
44
- 'unicorn/no-process-exit': 'off',
45
- 'unicorn/no-static-only-class': 'error',
46
- 'unicorn/no-this-assignment': 'off',
47
- 'unicorn/no-unreadable-array-destructuring': 'warn',
48
- 'unicorn/no-unsafe-regex': 'off',
49
- 'unicorn/no-unused-properties': 'off',
50
- 'unicorn/no-useless-length-check': 'off',
51
- 'unicorn/no-useless-spread': 'error',
52
- 'unicorn/no-useless-undefined': 'off',
53
- 'unicorn/no-zero-fractions': 'error',
54
- 'unicorn/number-literal-case': 'error',
55
- 'unicorn/numeric-separators-style': 'off',
56
- 'unicorn/prefer-add-event-listener': 'error',
57
- 'unicorn/prefer-array-find': 'warn',
58
- 'unicorn/prefer-array-flat': 'warn',
59
- 'unicorn/prefer-array-flat-map': 'warn',
60
- 'unicorn/prefer-array-index-of': 'warn',
61
- 'unicorn/prefer-array-some': 'warn',
62
- 'unicorn/prefer-at': 'warn',
63
- 'unicorn/prefer-date-now': 'warn',
64
- 'unicorn/prefer-default-parameters': 'error',
65
- 'unicorn/prefer-dom-node-append': 'warn',
66
- 'unicorn/prefer-dom-node-dataset': 'warn',
67
- 'unicorn/prefer-dom-node-remove': 'warn',
68
- 'unicorn/prefer-dom-node-text-content': 'warn',
69
- 'unicorn/prefer-includes': 'off',
70
- 'unicorn/prefer-keyboard-event-key': 'warn',
71
- 'unicorn/prefer-math-trunc': 'warn',
72
- 'unicorn/prefer-modern-dom-apis': 'warn',
73
- // FIXME [@rajzik]: This is good rule but adoption isn't great so far
74
- 'unicorn/prefer-module': 'off',
75
- // FIXME [eslint-plugin-import]: Once https://github.com/benmosher/eslint-plugin-import/issues/2035 is closed can be enabled
76
- 'unicorn/prefer-node-protocol': 'off',
77
- 'unicorn/prefer-negative-index': 'warn',
78
- 'unicorn/prefer-number-properties': 'warn',
79
- 'unicorn/prefer-object-from-entries': 'warn',
80
- 'unicorn/prefer-object-has-own': 'warn',
81
- 'unicorn/prefer-optional-catch-binding': 'off',
82
- 'unicorn/prefer-prototype-methods': 'warn',
83
- 'unicorn/prefer-query-selector': 'off',
84
- 'unicorn/prefer-reflect-apply': 'off',
85
- 'unicorn/prefer-regexp-test': 'warn',
86
- // Autofix can be breaking
87
- 'unicorn/prefer-set-has': 'warn',
88
- 'unicorn/prefer-spread': 'error',
89
- 'unicorn/prefer-string-replace-all': 'warn',
90
- 'unicorn/prefer-string-slice': 'warn',
91
- 'unicorn/prefer-string-starts-ends-with': 'warn',
92
- 'unicorn/prefer-string-trim-start-end': 'warn',
93
- 'unicorn/prefer-switch': 'off',
94
- 'unicorn/prefer-ternary': 'off',
95
- // FIXME [@jakubmazanec]: enable when we support top-level await
96
- 'unicorn/prefer-top-level-await': 'off',
97
- 'unicorn/prefer-type-error': 'warn',
98
- 'unicorn/prevent-abbreviations': 'off',
99
- 'unicorn/require-array-join-separator': 'error',
100
- 'unicorn/require-number-to-fixed-digits-argument': 'error',
101
- 'unicorn/require-post-message-target-origin': 'error',
102
- 'unicorn/string-content': 'off',
103
- 'unicorn/throw-new-error': 'error', // require new when throwing an error
104
- };
105
- module.exports = config;
@@ -1,34 +0,0 @@
1
- import { ESLintConfig } from '@beemo/driver-eslint';
2
- import { TSX_EXTS_GROUP } from '@oriflame/lumos-common';
3
-
4
- const config: ESLintConfig = {
5
- rules: {
6
- 'node/no-sync': 'off',
7
- 'node/global-require': 'off',
8
- 'import/no-dynamic-require': 'off',
9
- 'no-underscore-dangle': 'off',
10
- 'eslint-comments/disable-enable-pair': 'off',
11
- 'eslint-comments/no-aggregating-enable': 'off',
12
- 'eslint-comments/no-duplicate-disable': 'off',
13
- 'eslint-comments/no-restricted-disable': 'off',
14
- 'eslint-comments/no-unlimited-disable': 'off',
15
- 'eslint-comments/no-unused-disable': 'off',
16
- 'eslint-comments/no-unused-enable': 'off',
17
- 'eslint-comments/no-use': 'off',
18
- 'eslint-comments/require-description': 'off',
19
- },
20
- overrides: [
21
- {
22
- files: [`*.${TSX_EXTS_GROUP}`],
23
- rules: {
24
- '@typescript-eslint/no-non-null-assertion': 'off',
25
- '@typescript-eslint/naming-convention': 'off',
26
- '@typescript-eslint/no-require-imports': 'off',
27
- '@typescript-eslint/prefer-nullish-coalescing': 'off',
28
- '@typescript-eslint/strict-boolean-expressions': 'off',
29
- },
30
- },
31
- ],
32
- };
33
-
34
- export = config;
@@ -1,143 +0,0 @@
1
- import { Path } from '@beemo/core';
2
- import { ESLintConfig } from '@beemo/driver-eslint';
3
- import {
4
- ASSET_EXT_PATTERN,
5
- CSS_EXT_PATTERN,
6
- EXTS,
7
- GQL_EXT_PATTERN,
8
- TJSX_EXTS_GROUP,
9
- } from '@oriflame/lumos-common';
10
-
11
- import a11yRules from '../rules/a11y';
12
- import eslintRules from '../rules/eslint';
13
- import commentsRules from '../rules/eslint-comments';
14
- import importRules from '../rules/import';
15
- import jestRules from '../rules/jest';
16
- import promiseRules from '../rules/promise';
17
- import reactRules from '../rules/react';
18
- import reactHooksRules from '../rules/react-hooks';
19
- import testingLibraryRules from '../rules/testing-library';
20
-
21
- const config: ESLintConfig = {
22
- root: true,
23
-
24
- parser: 'babel-eslint',
25
-
26
- parserOptions: {
27
- requireConfigFile: false,
28
- ecmaVersion: 2020,
29
- sourceType: 'module',
30
- ecmaFeatures: {
31
- jsx: true,
32
- },
33
- },
34
- // Extends list for base plugins
35
- extends: [
36
- 'eslint:recommended',
37
- 'plugin:react/recommended',
38
- 'plugin:react-hooks/recommended',
39
- 'plugin:jsx-a11y/recommended',
40
- 'plugin:eslint-plugin-promise/recommended',
41
- ],
42
- // Required plugins; doesn't matter if they are used or not.
43
- plugins: ['import', 'react', 'react-hooks', 'jsx-a11y', 'node', 'eslint-comments', 'promise'],
44
-
45
- env: {
46
- browser: true,
47
- es2020: true,
48
- worker: true,
49
- serviceworker: true,
50
- },
51
-
52
- globals: {
53
- __DEV__: 'readonly',
54
-
55
- // metrics and analytics providers
56
- ga: 'readonly',
57
- newrelic: 'readonly',
58
-
59
- // mostly for easier compatibility between browsers, workers, etc
60
- global: 'readonly',
61
-
62
- // mostly references to `process.env.NODE_ENV`
63
- process: 'readonly',
64
-
65
- // references for globalThis
66
- globalThis: 'readonly',
67
-
68
- // Webpack variables
69
- __webpack_public_path__: 'writeable',
70
- __webpack_require__: 'readonly',
71
- __webpack_chunk_load__: 'readonly',
72
- __webpack_modules__: 'readonly',
73
- __webpack_hash__: 'readonly',
74
- __non_webpack_require__: 'readonly',
75
- __webpack_exports_info__: 'readonly',
76
- DEBUG: 'readonly',
77
- },
78
-
79
- reportUnusedDisableDirectives: true,
80
-
81
- settings: {
82
- 'import/ignore': [
83
- 'node_modules',
84
- '\\.json$',
85
- ASSET_EXT_PATTERN.source,
86
- CSS_EXT_PATTERN.source,
87
- GQL_EXT_PATTERN.source,
88
- ],
89
- 'import/extensions': EXTS,
90
- 'import/resolver': {
91
- node: {
92
- extensions: EXTS,
93
- },
94
- [Path.resolve('../resolvers/graphql.js', __dirname).path()]: {
95
- extensions: ['.gql', '.graphql'],
96
- },
97
- },
98
- react: {
99
- version: 'detect',
100
- },
101
- propWrapperFunctions: ['forbidExtraProps', 'exact', 'Object.freeze'],
102
- },
103
-
104
- rules: {
105
- ...eslintRules,
106
- ...commentsRules,
107
- ...promiseRules,
108
- ...importRules,
109
- ...reactRules,
110
- ...reactHooksRules,
111
- ...a11yRules,
112
- },
113
- overrides: [
114
- {
115
- files: [`*.test.${TJSX_EXTS_GROUP}`],
116
-
117
- plugins: ['jest', 'testing-library'],
118
-
119
- extends: ['plugin:jest/recommended', 'plugin:testing-library/react'],
120
-
121
- settings: {
122
- 'testing-library/custom-queries': 'off',
123
- 'testing-library/custom-renders': 'off',
124
- 'testing-library/utils-module': 'off',
125
- },
126
-
127
- globals: {
128
- jsdom: 'readonly',
129
- },
130
-
131
- env: {
132
- jest: true,
133
- node: true,
134
- },
135
- rules: {
136
- ...jestRules,
137
- ...testingLibraryRules,
138
- },
139
- },
140
- ],
141
- };
142
-
143
- export = config;
@@ -1,13 +0,0 @@
1
- import { ESLintConfig } from '@beemo/driver-eslint';
2
-
3
- import unicornRules from '../rules/unicorn';
4
-
5
- const config: ESLintConfig = {
6
- extends: ['plugin:unicorn/recommended'],
7
- plugins: ['unicorn'],
8
- rules: {
9
- ...unicornRules,
10
- },
11
- };
12
-
13
- export = config;
@@ -1,13 +0,0 @@
1
- import { ESLintConfig } from '@beemo/driver-eslint';
2
-
3
- import nextjsRules from '../rules/nextjs';
4
-
5
- const config: ESLintConfig = {
6
- extends: ['plugin:@next/next/recommended'],
7
- plugins: ['@next/next'],
8
- rules: {
9
- ...nextjsRules,
10
- },
11
- };
12
-
13
- export = config;
@@ -1,27 +0,0 @@
1
- import { ESLintConfig } from '@beemo/driver-eslint';
2
-
3
- import nodeRules from '../rules/node';
4
-
5
- const config: ESLintConfig = {
6
- // TODO: this also sets up globals and `parserOptions.sourceType`, so we should decide in later versions of this config if we want to use this `extends`
7
- // extends: ['plugin:node/recommended'],
8
-
9
- env: {
10
- browser: false,
11
- node: true,
12
- },
13
- settings: {
14
- node: {
15
- tryExtensions: ['.js', '.jsx', '.json'],
16
- },
17
- convertPath: {
18
- 'src/**/*.ts': ['^src/(.+?)\\.ts$', 'lib/$1.js'],
19
- 'src/**/*.tsx': ['^src/(.+?)\\.tsx$', 'lib/$1.js'],
20
- },
21
- },
22
- rules: {
23
- ...nodeRules,
24
- },
25
- };
26
-
27
- export = config;
@@ -1,13 +0,0 @@
1
- import { ESLintConfig } from '@beemo/driver-eslint';
2
-
3
- import prettierRules from '../rules/prettier';
4
-
5
- const config: ESLintConfig = {
6
- extends: ['eslint-config-prettier'],
7
- plugins: ['eslint-plugin-prettier'],
8
- rules: {
9
- ...prettierRules,
10
- },
11
- };
12
-
13
- export = config;
@@ -1,45 +0,0 @@
1
- import { ESLintConfig } from '@beemo/driver-eslint';
2
- import { EXTS, TSX_EXTS_GROUP, fromRoot } from '@oriflame/lumos-common';
3
-
4
- import typescriptRules from '../rules/typescript';
5
-
6
- const project = fromRoot('tsconfig.eslint.json', true) || fromRoot('tsconfig.json');
7
-
8
- const config: ESLintConfig = {
9
- overrides: [
10
- {
11
- files: [`*.${TSX_EXTS_GROUP}`],
12
-
13
- plugins: ['@typescript-eslint'],
14
-
15
- parser: '@typescript-eslint/parser',
16
-
17
- parserOptions: {
18
- project,
19
- },
20
-
21
- settings: {
22
- node: {
23
- tryExtensions: EXTS,
24
- },
25
- 'import/resolver': {
26
- typescript: {},
27
- },
28
- 'import/parsers': {
29
- '@typescript-eslint/parser': ['.ts', '.tsx'],
30
- },
31
- },
32
- rules: {
33
- ...typescriptRules,
34
- },
35
- },
36
- {
37
- files: [`*.test.${TSX_EXTS_GROUP}`],
38
- rules: {
39
- '@typescript-eslint/ban-ts-comment': 'off',
40
- },
41
- },
42
- ],
43
- };
44
-
45
- export = config;
@@ -1,11 +0,0 @@
1
- import { GQL_EXT_PATTERN } from '@oriflame/lumos-common';
2
-
3
- export const interfaceVersion = 2;
4
-
5
- export function resolve(source: string): { found: boolean; path?: unknown } {
6
- if (GQL_EXT_PATTERN.test(source)) {
7
- return { found: true, path: null };
8
- }
9
-
10
- return { found: false };
11
- }
package/src/rules/a11y.ts DELETED
@@ -1,47 +0,0 @@
1
- import { ESLintConfig } from '@beemo/driver-eslint';
2
-
3
- const config: ESLintConfig['rules'] = {
4
- // eslint-plugin-jsx-a11y rules
5
- 'jsx-a11y/alt-text': 'warn', // enforce all elements that require alternative text have meaningful information to relay back to end user
6
- 'jsx-a11y/anchor-has-content': ['warn', { components: ['Link'] }], // enforce all anchors to contain accessible content
7
- 'jsx-a11y/anchor-is-valid': [
8
- 'error',
9
- {
10
- components: ['Link'],
11
- specialLink: ['hrefLeft', 'hrefRight', 'to'],
12
- },
13
- ], // enforce all anchors are valid, navigable elements
14
- 'jsx-a11y/aria-activedescendant-has-tabindex': 'warn', // enforce elements with aria-active descendant are tab-able
15
- 'jsx-a11y/aria-props': 'error', // enforce all aria-* props are valid
16
- 'jsx-a11y/aria-proptypes': 'error', // enforce ARIA state and property values are valid
17
- 'jsx-a11y/aria-role': ['error', { ignoreNonDOM: false }], // enforce that elements with ARIA roles must use a valid, non-abstract ARIA role
18
- 'jsx-a11y/aria-unsupported-elements': 'error', // enforce that elements that do not support ARIA roles, states, and properties do not have those attributes
19
- 'jsx-a11y/autocomplete-valid': 'warn', // enforce that autocomplete attributes are used correctly.
20
- 'jsx-a11y/click-events-have-key-events': 'warn', // enforce a clickable non-interactive element has at least one keyboard event listener
21
- 'jsx-a11y/control-has-associated-label': 'warn', // enforce that a control (an interactive element) has a text label
22
- 'jsx-a11y/heading-has-content': ['warn', { components: ['Typography'] }], // enforce heading (h1, h2, etc) elements contain accessible content
23
- 'jsx-a11y/html-has-lang': 'warn', // enforce <html> element has lang prop
24
- 'jsx-a11y/iframe-has-title': 'warn', // enforce iframe elements have a title attribute
25
- 'jsx-a11y/img-redundant-alt': 'warn', // enforce <img> alt prop does not contain the word "image", "picture", or "photo"
26
- 'jsx-a11y/interactive-supports-focus': 'warn', // enforce that elements with interactive handlers like onClick must be focusable
27
- 'jsx-a11y/label-has-associated-control': 'warn', // enforce that a label tag has a text label and an associated control
28
- 'jsx-a11y/lang': 'error', // enforce lang attribute has a valid value
29
- 'jsx-a11y/media-has-caption': 'warn', // enforces that <audio> and <video> elements must have a <track> for captions
30
- 'jsx-a11y/mouse-events-have-key-events': 'warn', // enforce that onMouseOver/onMouseOut are accompanied by onFocus/onBlur for keyboard-only users
31
- 'jsx-a11y/no-access-key': 'warn', // enforce that the accessKey prop is not used on any element to avoid complications with keyboard commands used by a screen reader
32
- 'jsx-a11y/no-autofocus': 'off', // enforce autoFocus prop is not used
33
- 'jsx-a11y/no-distracting-elements': 'error', // enforce distracting elements are not used
34
- 'jsx-a11y/no-interactive-element-to-noninteractive-role': 'warn', // interactive elements should not be assigned non-interactive roles
35
- 'jsx-a11y/no-noninteractive-element-interactions': 'warn', // non-interactive elements should not be assigned mouse or keyboard event listeners
36
- 'jsx-a11y/no-noninteractive-element-to-interactive-role': 'warn', // Non-interactive elements should not be assigned interactive roles
37
- 'jsx-a11y/no-noninteractive-tabindex': 'error', // tabIndex should only be declared on interactive elements
38
- 'jsx-a11y/no-onchange': 'warn', // enforce usage of onBlur over onChange on select menus for accessibility
39
- 'jsx-a11y/no-redundant-roles': 'error', // enforce explicit role property is not the same as implicit/default role property on element
40
- 'jsx-a11y/no-static-element-interactions': 'warn', // enforce that non-interactive, visible elements (such as <div>) that have click handlers use the role attribute
41
- 'jsx-a11y/role-has-required-aria-props': 'error', // enforce that elements with ARIA roles must have all required attributes for that role
42
- 'jsx-a11y/role-supports-aria-props': 'error', // enforce that elements with explicit or implicit roles defined contain only aria-* properties supported by that role
43
- 'jsx-a11y/scope': 'error', // enforce scope prop is only used on <th> elements
44
- 'jsx-a11y/tabindex-no-positive': 'error', // enforce tabIndex value is not greater than zero
45
- };
46
-
47
- export = config;
@@ -1,16 +0,0 @@
1
- import { ESLintConfig } from '@beemo/driver-eslint';
2
-
3
- const config: ESLintConfig['rules'] = {
4
- // eslint-plugin-eslint-comments rules
5
- 'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }], // require a eslint-enable comment for every eslint-disable comment
6
- 'eslint-comments/no-aggregating-enable': 'error', // disallow a eslint-enable comment for multiple eslint-disable comments
7
- 'eslint-comments/no-duplicate-disable': 'error', // disallow duplicate eslint-disable comments
8
- 'eslint-comments/no-restricted-disable': 'off', // disallow eslint-disable comments about specific rules
9
- 'eslint-comments/no-unlimited-disable': 'error', // disallow eslint-disable comments without rule names
10
- 'eslint-comments/no-unused-disable': 'off', // disallow unused eslint-disable comments
11
- 'eslint-comments/no-unused-enable': 'error', // disallow unused eslint-enable comments
12
- 'eslint-comments/no-use': 'off', // disallow ESLint directive-comments
13
- 'eslint-comments/require-description': ['error', { ignore: ['eslint-enable'] }], // require include descriptions in ESLint directive-comments
14
- };
15
-
16
- export = config;