Skip to content

Commit 48b1250

Browse files
committed
Change property name, fix tests
1 parent 773043f commit 48b1250

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ You should also specify settings that will be shared across all the plugin rules
6363
"formComponents": [
6464
// Components used as alternatives to <form> for forms, eg. <Form endpoint={ url } />
6565
"CustomForm",
66-
{"name": "Form", "formAttributes": ["registerEnpoint", "loginEnpoint"]}, // allows specifying multiple properties if necessary
67-
{"name": "SimpleForm", "formAttribute": "endpoint"}, // deprecated backwards-compatible version
66+
{"name": "SimpleForm", "formAttribute": "endpoint"},
67+
{"name": "Form", "formAttribute": ["registerEndpoint", "loginEndpoint"]}, // allows specifying multiple properties if necessary
6868
],
6969
"linkComponents": [
7070
// Components used as alternatives to <a> for linking, eg. <Link to={ url } />
7171
"Hyperlink",
72-
{"name": "Link", "linkAttributes": ["to", "href"]} // allows specifying multiple properties if necessary
73-
{"name": "MyLink", "linkAttribute": "to"} // deprecated backwards-compatible version
72+
{"name": "MyLink", "linkAttribute": "to"},
73+
{"name": "Link", "linkAttribute": ["to", "href"]}, // allows specifying multiple properties if necessary
7474
]
7575
}
7676
}

tests/lib/rules/jsx-no-script-url.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ ruleTester.run('jsx-no-script-url', rule, {
7171
errors: [{ messageId: 'noScriptURL' }],
7272
settings: {
7373
linkComponents: [
74-
{ name: 'Foo', linkAttributes: ['to'] }
74+
{ name: 'Foo', linkAttribute: ['to'] }
7575
]
7676
},
7777
},
@@ -80,7 +80,7 @@ ruleTester.run('jsx-no-script-url', rule, {
8080
errors: [{ messageId: 'noScriptURL' }],
8181
settings: {
8282
linkComponents: [
83-
{ name: 'Foo', linkAttributes: ['to'] }
83+
{ name: 'Foo', linkAttribute: ['to'] }
8484
]
8585
},
8686
},
@@ -120,7 +120,7 @@ ruleTester.run('jsx-no-script-url', rule, {
120120
],
121121
settings: {
122122
linkComponents: [
123-
{ name: 'Foo', linkAttributes: ['to', 'href'] }
123+
{ name: 'Foo', linkAttribute: ['to', 'href'] }
124124
]
125125
},
126126
},

tests/util/linkComponents.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe('linkComponentsFunctions', () => {
2121
},
2222
{
2323
name: 'Link2',
24-
linkAttributes: ['to1', 'to2'],
24+
linkAttribute: ['to1', 'to2'],
2525
},
2626
];
2727
const context = {
@@ -51,11 +51,11 @@ describe('linkComponentsFunctions', () => {
5151
'Form',
5252
{
5353
name: 'MyForm',
54-
linkAttribute: 'endpoint',
54+
formAttribute: 'endpoint',
5555
},
5656
{
5757
name: 'MyForm2',
58-
linkAttributes: ['endpoint1', 'endpoint2'],
58+
formAttribute: ['endpoint1', 'endpoint2'],
5959
},
6060
];
6161
const context = {

0 commit comments

Comments
 (0)