Skip to content

Commit c5c7494

Browse files
committed
resolve conflicts
2 parents 7c36070 + b381547 commit c5c7494

20 files changed

+122
-90
lines changed

.eslintrc

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -22,61 +22,61 @@
2222
"object-shorthand": [2, "always", {
2323
"ignoreConstructors": false,
2424
"avoidQuotes": false, // this is the override vs airbnb
25-
}],
26-
"max-len": [2, 120, {
27-
"ignoreStrings": true,
28-
"ignoreTemplateLiterals": true,
29-
"ignoreComments": true,
30-
}],
31-
"consistent-return": 0,
25+
}],
26+
"max-len": [2, 140, {
27+
"ignoreStrings": true,
28+
"ignoreTemplateLiterals": true,
29+
"ignoreComments": true,
30+
}],
31+
"consistent-return": 0,
3232

33-
"prefer-destructuring": [2, { "array": false, "object": false }, { "enforceForRenamedProperties": false }],
34-
"prefer-object-spread": 0, // until node 8 is required
35-
"prefer-rest-params": 0, // until node 6 is required
36-
"prefer-spread": 0, // until node 6 is required
37-
"function-call-argument-newline": 1, // TODO: enable
38-
"function-paren-newline": 0,
39-
"no-plusplus": [2, {"allowForLoopAfterthoughts": true}],
40-
"no-param-reassign": 1,
41-
"no-restricted-syntax": [2, {
42-
"selector": "ObjectPattern",
43-
"message": "Object destructuring is not compatible with Node v4"
44-
}],
45-
"strict": [2, "safe"],
46-
"valid-jsdoc": [2, {
47-
"requireReturn": false,
48-
"requireParamDescription": false,
49-
"requireReturnDescription": false,
50-
}],
33+
"prefer-destructuring": [2, { "array": false, "object": false }, { "enforceForRenamedProperties": false }],
34+
"prefer-object-spread": 0, // until node 8 is required
35+
"prefer-rest-params": 0, // until node 6 is required
36+
"prefer-spread": 0, // until node 6 is required
37+
"function-call-argument-newline": 1, // TODO: enable
38+
"function-paren-newline": 0,
39+
"no-plusplus": [2, {"allowForLoopAfterthoughts": true}],
40+
"no-param-reassign": 1,
41+
"no-restricted-syntax": [2, {
42+
"selector": "ObjectPattern",
43+
"message": "Object destructuring is not compatible with Node v4"
44+
}],
45+
"strict": [2, "safe"],
46+
"valid-jsdoc": [2, {
47+
"requireReturn": false,
48+
"requireParamDescription": false,
49+
"requireReturnDescription": false,
50+
}],
5151

52-
"eslint-plugin/consistent-output": 0,
53-
"eslint-plugin/require-meta-docs-description": [2, { "pattern": "^(Enforce|Require|Disallow)" }],
54-
"eslint-plugin/require-meta-schema": 0,
55-
"eslint-plugin/require-meta-type": 0
56-
},
57-
"overrides": [
58-
{
59-
"files": "tests/**",
60-
"rules": {
61-
"no-template-curly-in-string": 1,
62-
},
63-
},
64-
{
65-
"files": "markdown.config.js",
66-
"rules": {
67-
"no-console": 0,
68-
},
69-
},
70-
{
71-
"files": ".github/workflows/*.js",
72-
"parserOptions": {
73-
"ecmaVersion": 2019,
74-
},
75-
"rules": {
76-
"camelcase": 0,
77-
"no-console": 0,
78-
"no-restricted-syntax": 0,
79-
},
80-
},
81-
],
82-
}
52+
"eslint-plugin/consistent-output": 0,
53+
"eslint-plugin/require-meta-docs-description": [2, { "pattern": "^(Enforce|Require|Disallow)" }],
54+
"eslint-plugin/require-meta-schema": 0,
55+
"eslint-plugin/require-meta-type": 0
56+
},
57+
"overrides": [
58+
{
59+
"files": "tests/**",
60+
"rules": {
61+
"no-template-curly-in-string": 1,
62+
},
63+
},
64+
{
65+
"files": "markdown.config.js",
66+
"rules": {
67+
"no-console": 0,
68+
},
69+
},
70+
{
71+
"files": ".github/workflows/*.js",
72+
"parserOptions": {
73+
"ecmaVersion": 2019,
74+
},
75+
"rules": {
76+
"camelcase": 0,
77+
"no-console": 0,
78+
"no-restricted-syntax": 0,
79+
},
80+
},
81+
],
82+
}

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,15 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
55

66
## Unreleased
77

8+
### Added
9+
10+
* [`jsx-closing-tag-location`]: add `line-aligned` option ([#3777] @kimtaejin3)
11+
812
### Fixed
913

1014
* [`prop-types`]: fix `className` missing in prop validation false negative ([#3749] @akulsr0)
1115

16+
[#3777]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3777
1217
[#3749]: https://github.com/jsx-eslint/eslint-plugin-react/pull/3749
1318

1419
## [7.34.3] - 2024.06.18

docs/rules/jsx-closing-tag-location.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ const App = <Bar>
109109
Foo
110110
</Bar>;
111111

112+
<<<<<<< HEAD
113+
=======
114+
115+
>>>>>>> b381547982addc145bd58a184a18e4e6665d2b03
112116
```
113117

114118
## When Not To Use It

lib/rules/forbid-elements.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
'use strict';
77

8-
const has = require('object.hasown/polyfill')();
8+
const has = require('hasown');
99
const docsUrl = require('../util/docsUrl');
1010
const getText = require('../util/eslint').getText;
1111
const isCreateElement = require('../util/isCreateElement');
@@ -60,6 +60,7 @@ module.exports = {
6060
const configuration = context.options[0] || {};
6161
const forbidConfiguration = configuration.forbid || [];
6262

63+
/** @type {Record<string, { element: string, message?: string }>} */
6364
const indexedForbidConfigs = {};
6465

6566
forbidConfiguration.forEach((item) => {

lib/rules/jsx-closing-bracket-location.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55

66
'use strict';
77

8-
const has = require('object.hasown/polyfill')();
8+
const has = require('hasown');
9+
const repeat = require('string.prototype.repeat');
10+
911
const docsUrl = require('../util/docsUrl');
1012
const getSourceCode = require('../util/eslint').getSourceCode;
1113
const report = require('../util/report');
@@ -168,7 +170,7 @@ module.exports = {
168170
function getIndentation(tokens, expectedLocation, correctColumn) {
169171
const newColumn = correctColumn || 0;
170172
let indentation;
171-
let spaces = [];
173+
let spaces = '';
172174
switch (expectedLocation) {
173175
case 'props-aligned':
174176
indentation = /^\s*/.exec(getSourceCode(context).lines[tokens.lastProp.firstLine - 1])[0];
@@ -182,9 +184,9 @@ module.exports = {
182184
}
183185
if (indentation.length + 1 < newColumn) {
184186
// Non-whitespace characters were included in the column offset
185-
spaces = new Array(+correctColumn + 1 - indentation.length);
187+
spaces = repeat(' ', +correctColumn + 1 - indentation.length);
186188
}
187-
return indentation + spaces.join(' ');
189+
return indentation + spaces;
188190
}
189191

190192
/**

lib/rules/jsx-closing-tag-location.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55

66
'use strict';
77

8-
const has = require('object.hasown/polyfill')();
8+
const repeat = require('string.prototype.repeat');
9+
const has = require('hasown');
10+
911
const astUtil = require('../util/ast');
1012
const docsUrl = require('../util/docsUrl');
1113
const getSourceCode = require('../util/eslint').getSourceCode;
@@ -109,7 +111,7 @@ module.exports = {
109111
node,
110112
loc: node.loc,
111113
fix(fixer) {
112-
const indent = Array(getIndentation(openingStartOfLine, opening)).join(' ');
114+
const indent = repeat(' ', getIndentation(openingStartOfLine, opening));
113115

114116
if (astUtil.isNodeFirstInLine(context, node)) {
115117
return fixer.replaceTextRange(

lib/rules/jsx-curly-spacing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
'use strict';
1313

14-
const has = require('object.hasown/polyfill')();
14+
const has = require('hasown');
1515
const docsUrl = require('../util/docsUrl');
1616
const getSourceCode = require('../util/eslint').getSourceCode;
1717
const report = require('../util/report');

lib/rules/jsx-indent-props.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030

3131
'use strict';
3232

33+
const repeat = require('string.prototype.repeat');
34+
3335
const astUtil = require('../util/ast');
3436
const docsUrl = require('../util/docsUrl');
3537
const getText = require('../util/eslint').getText;
@@ -130,7 +132,8 @@ module.exports = {
130132
data: msgContext,
131133
fix(fixer) {
132134
return fixer.replaceTextRange([node.range[0] - node.loc.start.column, node.range[0]],
133-
Array(needed + 1).join(indentType === 'space' ? ' ' : '\t'));
135+
repeat(indentType === 'space' ? ' ' : '\t', needed + 1)
136+
);
134137
},
135138
});
136139
}

lib/rules/jsx-indent.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
'use strict';
3232

3333
const matchAll = require('string.prototype.matchall');
34+
const repeat = require('string.prototype.repeat');
3435

3536
const astUtil = require('../util/ast');
3637
const docsUrl = require('../util/docsUrl');
@@ -109,7 +110,7 @@ module.exports = {
109110
* @private
110111
*/
111112
function getFixerFunction(node, needed) {
112-
const indent = Array(needed + 1).join(indentChar);
113+
const indent = repeat(indentChar, needed + 1);
113114

114115
if (node.type === 'JSXText' || node.type === 'Literal') {
115116
return function fix(fixer) {

lib/rules/jsx-max-depth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
'use strict';
77

8-
const has = require('object.hasown/polyfill')();
8+
const has = require('hasown');
99
const includes = require('array-includes');
1010
const variableUtil = require('../util/variable');
1111
const jsxUtil = require('../util/jsx');

0 commit comments

Comments
 (0)