@w5s/eslint-config 1.0.0-alpha.49 → 1.0.0-alpha.50

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/index.js CHANGED
@@ -28,7 +28,6 @@ module.exports = {
28
28
  require.resolve('./json.js'),
29
29
  require.resolve('./yml.js'),
30
30
  require.resolve('./jest.js'),
31
- ...includeIf(tryResolve('react'), () => require.resolve('./react.js')),
32
31
  ],
33
32
  root: true,
34
33
  };
package/lib/es/import.js CHANGED
@@ -3,13 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  const dev_1 = require("@w5s/dev");
6
- // @ts-ignore
6
+ // @ts-ignore airbnb is not typed
7
7
  const imports_1 = __importDefault(require("eslint-config-airbnb-base/rules/imports"));
8
8
  const _rule_js_1 = require("../_rule.js");
9
9
  // @see https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#eslint-plugin-import
10
- const config = dev_1.ESLintConfig.concat(
11
- // @ts-ignore
12
- imports_1.default,
10
+ const config = dev_1.ESLintConfig.concat(imports_1.default,
13
11
  // Overrides
14
12
  {
15
13
  rules: {
package/lib/es/promise.js CHANGED
@@ -5,7 +5,6 @@ const config = dev_1.ESLintConfig.concat({
5
5
  extends: ['plugin:promise/recommended'],
6
6
  plugins: ['promise'],
7
7
  rules: {
8
- // https://github.com/xjamundx/eslint-plugin-promise/issues/212
9
8
  'promise/prefer-await-to-callbacks': (0, _rule_js_1.fixme)('error'),
10
9
  'promise/prefer-await-to-then': 'error',
11
10
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@w5s/eslint-config",
3
- "version": "1.0.0-alpha.49",
3
+ "version": "1.0.0-alpha.50",
4
4
  "description": "ESLint configuration presets",
5
5
  "keywords": [
6
6
  "eslint",
@@ -34,10 +34,10 @@
34
34
  ],
35
35
  "scripts": {
36
36
  "build": "concurrently \"npm:build:*\" \":\"",
37
- "build:tsc": "tsc",
37
+ "build:tsc": "tsc -b tsconfig.build.json",
38
38
  "clean": "concurrently \"npm:clean:*\" \":\"",
39
39
  "clean:src": "rm -rf lib/*",
40
- "docs": "md-magic --path '**/*.md' --ignore='node_modules'",
40
+ "docs": "node ../../markdown.mjs",
41
41
  "format": "concurrently \"npm:format:*\" \":\"",
42
42
  "format:src": "eslint . --fix --ext=mjs,cjs,js,jsx,ts,tsx,json,jsonc,json5,yml,yaml",
43
43
  "lint": "concurrently \"npm:lint:*\" \":\"",
@@ -59,33 +59,30 @@
59
59
  "@rushstack/eslint-patch": "^1.1.0",
60
60
  "@typescript-eslint/eslint-plugin": "^5.0.0",
61
61
  "@typescript-eslint/parser": "^5.0.0",
62
- "@w5s/dev": "^1.0.0-alpha.4",
63
- "@w5s/prettier-config": "^1.0.8",
62
+ "@w5s/dev": "^1.0.0-alpha.5",
63
+ "@w5s/prettier-config": "^1.0.9",
64
64
  "eslint-config-airbnb-base": "^15.0.0",
65
65
  "eslint-config-prettier": "^8.0.0",
66
- "eslint-plugin-functional": "^4.2.0",
67
66
  "eslint-plugin-import": "^2.25.0",
68
67
  "eslint-plugin-jest": "^27.0.0",
69
68
  "eslint-plugin-jsdoc": "^39.0.0",
70
69
  "eslint-plugin-jsonc": "^2.4.0",
71
70
  "eslint-plugin-prettier": "^4.0.0",
72
71
  "eslint-plugin-promise": "^6.0.0",
73
- "eslint-plugin-react": "^7.28.0",
74
- "eslint-plugin-total-functions": "^6.0.0",
75
72
  "eslint-plugin-unicorn": "^45.0.0",
76
73
  "eslint-plugin-yml": "^1.1.0",
77
74
  "find-up": "^5.0.0",
78
75
  "parse-gitignore": "^2.0.0"
79
76
  },
80
77
  "devDependencies": {
81
- "@types/eslint": "8.4.10",
78
+ "@types/eslint": "8.21.0",
82
79
  "@types/eslint-plugin-prettier": "3.1.0",
83
80
  "@types/jest": "29.4.0",
84
81
  "@types/parse-gitignore": "1.0.0",
85
82
  "@types/prettier": "2.7.2",
86
83
  "@types/react": "18.0.27",
87
- "@typescript-eslint/parser": "5.49.0",
88
- "eslint": "8.32.0",
84
+ "@typescript-eslint/parser": "5.50.0",
85
+ "eslint": "8.33.0",
89
86
  "eslint-config-prettier": "8.6.0",
90
87
  "eslint-find-rules": "4.1.0",
91
88
  "prettier": "2.8.3",
@@ -109,5 +106,5 @@
109
106
  "publishConfig": {
110
107
  "access": "public"
111
108
  },
112
- "gitHead": "dd093c2907cf8e136f4adec9a14b176e0851de17"
109
+ "gitHead": "cdb08978935c78ac2303b9a00f42f791e6361306"
113
110
  }
package/src/es/base.ts CHANGED
@@ -5,7 +5,7 @@ import { ECMA_VERSION, ESLintConfig } from '@w5s/dev';
5
5
  // @ts-ignore No typing available
6
6
  import '@rushstack/eslint-patch/modern-module-resolution.js';
7
7
  // @ts-ignore No typing available
8
- import bestPractisesConfig from 'eslint-config-airbnb-base/rules/best-practices';
8
+ import bestPracticesConfig from 'eslint-config-airbnb-base/rules/best-practices';
9
9
  // @ts-ignore No typing available
10
10
  import errorsConfig from 'eslint-config-airbnb-base/rules/errors';
11
11
  // @ts-ignore No typing available
@@ -20,7 +20,7 @@ import styleConfig from 'eslint-config-airbnb-base/rules/style';
20
20
  import variablesConfig from 'eslint-config-airbnb-base/rules/variables';
21
21
 
22
22
  const baseConfig = ESLintConfig.concat(
23
- bestPractisesConfig,
23
+ bestPracticesConfig,
24
24
  errorsConfig,
25
25
  es6Config,
26
26
  nodeConfig,
package/src/es/import.ts CHANGED
@@ -1,13 +1,12 @@
1
1
  import { ESLintConfig, EXTENSIONS, EXTENSIONS_RESOURCES_REGEX, IGNORE_LIST } from '@w5s/dev';
2
2
  import type eslint from 'eslint';
3
- // @ts-ignore
3
+ // @ts-ignore airbnb is not typed
4
4
  import importConfig from 'eslint-config-airbnb-base/rules/imports';
5
5
  import { fixme } from '../_rule.js';
6
6
 
7
7
  // @see https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#eslint-plugin-import
8
8
 
9
9
  const config: eslint.Linter.Config = ESLintConfig.concat(
10
- // @ts-ignore
11
10
  importConfig,
12
11
  // Overrides
13
12
  {
package/src/es/promise.ts CHANGED
@@ -6,8 +6,7 @@ const config: eslint.Linter.Config = ESLintConfig.concat({
6
6
  extends: ['plugin:promise/recommended'],
7
7
  plugins: ['promise'],
8
8
  rules: {
9
- // https://github.com/xjamundx/eslint-plugin-promise/issues/212
10
- 'promise/prefer-await-to-callbacks': fixme('error'),
9
+ 'promise/prefer-await-to-callbacks': fixme('error'), // https://github.com/xjamundx/eslint-plugin-promise/issues/212
11
10
  'promise/prefer-await-to-then': 'error',
12
11
  },
13
12
  });
package/functional.js DELETED
@@ -1,48 +0,0 @@
1
- // @see https://github.com/danielnixon/eslint-config-typed-fp/blob/master/src/index.ts
2
-
3
- module.exports = {
4
- overrides: [
5
- {
6
- extends: ['plugin:functional/recommended', 'plugin:total-functions/recommended'],
7
- files: [
8
- 'src/**/!(*.spec|*.ispec).ts',
9
- // 'src/**/!(*.spec).js'
10
- ],
11
- rules: {
12
- 'functional/functional-parameters': [
13
- 'error',
14
- {
15
- allowArgumentsKeyword: false,
16
- allowRestParameter: false,
17
- enforceParameterCount: false,
18
- },
19
- ],
20
- 'functional/no-conditional-statement': 'off',
21
- 'functional/no-method-signature': 'off',
22
- 'functional/prefer-readonly-type': [
23
- // @see https://github.com/jonaskello/eslint-plugin-functional/issues/51
24
- 'off', // error
25
- {
26
- // When you call methods like `filter` and `concat` on an array (_even a readonly_ array) you always get back a mutable array.
27
- // By default prefer-readonly-type won't catch these cases, but with the checkImplicit option on it will.
28
- // See https://github.com/jonaskello/eslint-plugin-functional/blob/master/docs/rules/prefer-readonly-type.md#checkimplicit
29
- // @see also https://github.com/danielnixon/readonly-types/issues/7
30
- // @see https://github.com/jonaskello/eslint-plugin-functional/issues/153
31
- checkImplicit: true,
32
- },
33
- ],
34
- 'functional/prefer-type-literal': 'off',
35
- 'total-functions/no-unsafe-readonly-mutable-assignment': [
36
- // @see https://github.com/danielnixon/eslint-plugin-total-functions/issues?q=is%3Aissue+is%3Aopen+no-unsafe-readonly-mutable-assignment
37
- 'off',
38
- ],
39
-
40
- 'total-functions/no-unsafe-type-assertion': [
41
- // Don't need this given consistent-type-assertions bans type assertions entirely.,
42
- 'off',
43
- ],
44
- },
45
- },
46
- ],
47
- plugins: ['functional', 'total-functions'],
48
- };
package/lib/react.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import type eslint from 'eslint';
2
- declare const config: eslint.Linter.Config;
3
- export = config;
package/lib/react.js DELETED
@@ -1,176 +0,0 @@
1
- "use strict";
2
- const config = {
3
- plugins: ['react'],
4
- rules: {
5
- 'react/boolean-prop-naming': 'off',
6
- 'react/button-has-type': 'error',
7
- 'react/default-props-match-prop-types': 'off',
8
- 'react/destructuring-assignment': 'off',
9
- 'react/display-name': 'off',
10
- 'react/forbid-component-props': 'off',
11
- 'react/forbid-dom-props': 'off',
12
- 'react/forbid-elements': 'off',
13
- 'react/forbid-foreign-prop-types': 'off',
14
- 'react/forbid-prop-types': 'off',
15
- 'react/jsx-boolean-value': ['error', 'never'],
16
- 'react/jsx-child-element-spacing': 'off',
17
- 'react/jsx-closing-bracket-location': 'off',
18
- 'react/jsx-closing-tag-location': 'off',
19
- 'react/jsx-curly-brace-presence': 'off',
20
- 'react/jsx-curly-newline': 'error',
21
- 'react/jsx-curly-spacing': [
22
- 'error',
23
- 'never',
24
- {
25
- allowMultiline: true,
26
- },
27
- ],
28
- 'react/jsx-equals-spacing': ['error', 'never'],
29
- 'react/jsx-first-prop-new-line': ['error', 'multiline-multiprop'],
30
- 'react/jsx-fragments': ['error', 'syntax'],
31
- 'react/jsx-handler-names': [
32
- 'error',
33
- {
34
- checkInlineFunction: false,
35
- checkLocalVariables: false,
36
- eventHandlerPrefix: 'handle',
37
- eventHandlerPropPrefix: 'on',
38
- },
39
- ],
40
- 'react/jsx-indent': ['error', 2],
41
- 'react/jsx-indent-props': ['error', 2],
42
- 'react/jsx-key': 'error',
43
- 'react/jsx-max-props-per-line': [
44
- 'error',
45
- {
46
- maximum: 3,
47
- when: 'multiline',
48
- },
49
- ],
50
- 'react/jsx-no-bind': [
51
- 'error',
52
- {
53
- allowArrowFunctions: true,
54
- allowBind: false,
55
- ignoreRefs: true,
56
- },
57
- ],
58
- 'react/jsx-no-comment-textnodes': 'error',
59
- 'react/jsx-no-duplicate-props': 'error',
60
- 'react/jsx-no-literals': 'off',
61
- 'react/jsx-no-target-blank': 'error',
62
- 'react/jsx-no-undef': 'error',
63
- 'react/jsx-one-expression-per-line': 'off',
64
- 'react/jsx-pascal-case': 'error',
65
- 'react/jsx-props-no-multi-spaces': 'error',
66
- 'react/jsx-props-no-spreading': 'off',
67
- 'react/jsx-sort-default-props': 'error',
68
- 'react/jsx-sort-props': [
69
- 'error',
70
- {
71
- callbacksLast: false,
72
- ignoreCase: true,
73
- noSortAlphabetically: false,
74
- reservedFirst: true,
75
- shorthandFirst: false,
76
- shorthandLast: false,
77
- },
78
- ],
79
- 'react/jsx-tag-spacing': [
80
- 'error',
81
- {
82
- afterOpening: 'never',
83
- beforeSelfClosing: 'always',
84
- closingSlash: 'never',
85
- },
86
- ],
87
- 'react/jsx-uses-react': 'warn',
88
- 'react/jsx-uses-vars': 'warn',
89
- 'react/jsx-wrap-multilines': 'off',
90
- 'react/no-access-state-in-setstate': 'error',
91
- 'react/no-array-index-key': 'error',
92
- 'react/no-children-prop': 'error',
93
- 'react/no-danger': 'error',
94
- 'react/no-danger-with-children': 'error',
95
- 'react/no-deprecated': 'error',
96
- 'react/no-did-mount-set-state': 'error',
97
- 'react/no-did-update-set-state': 'error',
98
- 'react/no-direct-mutation-state': 'error',
99
- 'react/no-find-dom-node': 'error',
100
- 'react/no-is-mounted': 'error',
101
- 'react/no-multi-comp': 'off',
102
- 'react/no-redundant-should-component-update': 'error',
103
- 'react/no-set-state': 'off',
104
- 'react/no-string-refs': 'error',
105
- 'react/no-this-in-sfc': 'error',
106
- 'react/no-typos': 'error',
107
- 'react/no-unescaped-entities': 'error',
108
- 'react/no-unknown-property': 'error',
109
- 'react/no-unsafe': 'error',
110
- 'react/no-unused-prop-types': 'error',
111
- 'react/no-unused-state': 'error',
112
- 'react/no-will-update-set-state': 'error',
113
- 'react/prefer-es6-class': 'error',
114
- 'react/prefer-read-only-props': 'warn',
115
- 'react/prefer-stateless-function': 'off',
116
- 'react/prop-types': 'off',
117
- 'react/react-in-jsx-scope': 'error',
118
- 'react/require-default-props': 'off',
119
- 'react/require-render-return': 'error',
120
- 'react/self-closing-comp': 'error',
121
- 'react/sort-comp': [
122
- 'error',
123
- {
124
- groups: {
125
- lifecycle: [
126
- 'displayName',
127
- 'propTypes',
128
- 'contextTypes',
129
- 'childContextTypes',
130
- 'mixins',
131
- 'statics',
132
- 'defaultProps',
133
- 'constructor',
134
- 'getDefaultProps',
135
- 'getInitialState',
136
- 'state',
137
- 'getChildContext',
138
- 'getDerivedStateFromProps',
139
- 'componentWillMount',
140
- 'UNSAFE_componentWillMount',
141
- 'componentDidMount',
142
- 'componentWillReceiveProps',
143
- 'UNSAFE_componentWillReceiveProps',
144
- 'shouldComponentUpdate',
145
- 'componentWillUpdate',
146
- 'UNSAFE_componentWillUpdate',
147
- 'getSnapshotBeforeUpdate',
148
- 'componentDidUpdate',
149
- 'componentWillUnmount',
150
- 'componentDidCatch',
151
- ],
152
- rendering: ['/^render.+$/', 'render'],
153
- },
154
- order: [
155
- 'static-variables',
156
- 'static-methods',
157
- 'instance-variables',
158
- 'lifecycle',
159
- '/^on.+$/',
160
- 'getters',
161
- 'setters',
162
- '/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/',
163
- 'instance-methods',
164
- 'everything-else',
165
- 'rendering',
166
- ],
167
- },
168
- ],
169
- 'react/sort-prop-types': 'error',
170
- 'react/state-in-constructor': ['error', 'never'],
171
- 'react/static-property-placement': 'error',
172
- 'react/style-prop-object': 'error',
173
- 'react/void-dom-elements-no-children': 'error',
174
- },
175
- };
176
- module.exports = config;
package/react.js DELETED
@@ -1,10 +0,0 @@
1
- // http://eslint.org/docs/user-guide/configuring
2
- module.exports = {
3
- extends: [require.resolve('./lib/react.js'), 'prettier'],
4
- settings: {
5
- react: {
6
- flowVersion: '0.100',
7
- version: 'detect',
8
- },
9
- },
10
- };
package/src/react.ts DELETED
@@ -1,177 +0,0 @@
1
- import type eslint from 'eslint';
2
-
3
- const config: eslint.Linter.Config = {
4
- plugins: ['react'],
5
- rules: {
6
- 'react/boolean-prop-naming': 'off',
7
- 'react/button-has-type': 'error',
8
- 'react/default-props-match-prop-types': 'off',
9
- 'react/destructuring-assignment': 'off',
10
- 'react/display-name': 'off',
11
- 'react/forbid-component-props': 'off',
12
- 'react/forbid-dom-props': 'off',
13
- 'react/forbid-elements': 'off',
14
- 'react/forbid-foreign-prop-types': 'off',
15
- 'react/forbid-prop-types': 'off',
16
- 'react/jsx-boolean-value': ['error', 'never'],
17
- 'react/jsx-child-element-spacing': 'off',
18
- 'react/jsx-closing-bracket-location': 'off',
19
- 'react/jsx-closing-tag-location': 'off',
20
- 'react/jsx-curly-brace-presence': 'off',
21
- 'react/jsx-curly-newline': 'error',
22
- 'react/jsx-curly-spacing': [
23
- 'error',
24
- 'never',
25
- {
26
- allowMultiline: true,
27
- },
28
- ],
29
- 'react/jsx-equals-spacing': ['error', 'never'],
30
- 'react/jsx-first-prop-new-line': ['error', 'multiline-multiprop'],
31
- 'react/jsx-fragments': ['error', 'syntax'],
32
- 'react/jsx-handler-names': [
33
- 'error',
34
- {
35
- checkInlineFunction: false,
36
- checkLocalVariables: false,
37
- eventHandlerPrefix: 'handle',
38
- eventHandlerPropPrefix: 'on',
39
- },
40
- ],
41
- 'react/jsx-indent': ['error', 2],
42
- 'react/jsx-indent-props': ['error', 2],
43
- 'react/jsx-key': 'error',
44
- 'react/jsx-max-props-per-line': [
45
- 'error',
46
- {
47
- maximum: 3,
48
- when: 'multiline',
49
- },
50
- ],
51
- 'react/jsx-no-bind': [
52
- 'error',
53
- {
54
- allowArrowFunctions: true,
55
- allowBind: false,
56
- ignoreRefs: true,
57
- },
58
- ],
59
- 'react/jsx-no-comment-textnodes': 'error',
60
- 'react/jsx-no-duplicate-props': 'error',
61
- 'react/jsx-no-literals': 'off',
62
- 'react/jsx-no-target-blank': 'error',
63
- 'react/jsx-no-undef': 'error',
64
- 'react/jsx-one-expression-per-line': 'off',
65
- 'react/jsx-pascal-case': 'error',
66
- 'react/jsx-props-no-multi-spaces': 'error',
67
- 'react/jsx-props-no-spreading': 'off',
68
- 'react/jsx-sort-default-props': 'error',
69
- 'react/jsx-sort-props': [
70
- 'error',
71
- {
72
- callbacksLast: false,
73
- ignoreCase: true,
74
- noSortAlphabetically: false,
75
- reservedFirst: true,
76
- shorthandFirst: false,
77
- shorthandLast: false,
78
- },
79
- ],
80
- 'react/jsx-tag-spacing': [
81
- 'error',
82
- {
83
- afterOpening: 'never',
84
- beforeSelfClosing: 'always',
85
- closingSlash: 'never',
86
- },
87
- ],
88
- 'react/jsx-uses-react': 'warn',
89
- 'react/jsx-uses-vars': 'warn',
90
- 'react/jsx-wrap-multilines': 'off',
91
- 'react/no-access-state-in-setstate': 'error',
92
- 'react/no-array-index-key': 'error',
93
- 'react/no-children-prop': 'error',
94
- 'react/no-danger': 'error',
95
- 'react/no-danger-with-children': 'error',
96
- 'react/no-deprecated': 'error',
97
- 'react/no-did-mount-set-state': 'error',
98
- 'react/no-did-update-set-state': 'error',
99
- 'react/no-direct-mutation-state': 'error',
100
- 'react/no-find-dom-node': 'error',
101
- 'react/no-is-mounted': 'error',
102
- 'react/no-multi-comp': 'off',
103
- 'react/no-redundant-should-component-update': 'error',
104
- 'react/no-set-state': 'off',
105
- 'react/no-string-refs': 'error',
106
- 'react/no-this-in-sfc': 'error',
107
- 'react/no-typos': 'error',
108
- 'react/no-unescaped-entities': 'error',
109
- 'react/no-unknown-property': 'error',
110
- 'react/no-unsafe': 'error',
111
- 'react/no-unused-prop-types': 'error',
112
- 'react/no-unused-state': 'error',
113
- 'react/no-will-update-set-state': 'error',
114
- 'react/prefer-es6-class': 'error',
115
- 'react/prefer-read-only-props': 'warn',
116
- 'react/prefer-stateless-function': 'off',
117
- 'react/prop-types': 'off',
118
- 'react/react-in-jsx-scope': 'error',
119
- 'react/require-default-props': 'off',
120
- 'react/require-render-return': 'error',
121
- 'react/self-closing-comp': 'error',
122
- 'react/sort-comp': [
123
- 'error',
124
- {
125
- groups: {
126
- lifecycle: [
127
- 'displayName',
128
- 'propTypes',
129
- 'contextTypes',
130
- 'childContextTypes',
131
- 'mixins',
132
- 'statics',
133
- 'defaultProps',
134
- 'constructor',
135
- 'getDefaultProps',
136
- 'getInitialState',
137
- 'state',
138
- 'getChildContext',
139
- 'getDerivedStateFromProps',
140
- 'componentWillMount',
141
- 'UNSAFE_componentWillMount',
142
- 'componentDidMount',
143
- 'componentWillReceiveProps',
144
- 'UNSAFE_componentWillReceiveProps',
145
- 'shouldComponentUpdate',
146
- 'componentWillUpdate',
147
- 'UNSAFE_componentWillUpdate',
148
- 'getSnapshotBeforeUpdate',
149
- 'componentDidUpdate',
150
- 'componentWillUnmount',
151
- 'componentDidCatch',
152
- ],
153
- rendering: ['/^render.+$/', 'render'],
154
- },
155
- order: [
156
- 'static-variables',
157
- 'static-methods',
158
- 'instance-variables',
159
- 'lifecycle',
160
- '/^on.+$/',
161
- 'getters',
162
- 'setters',
163
- '/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/',
164
- 'instance-methods',
165
- 'everything-else',
166
- 'rendering',
167
- ],
168
- },
169
- ],
170
- 'react/sort-prop-types': 'error',
171
- 'react/state-in-constructor': ['error', 'never'],
172
- 'react/static-property-placement': 'error',
173
- 'react/style-prop-object': 'error',
174
- 'react/void-dom-elements-no-children': 'error',
175
- },
176
- };
177
- export = config;