2019-08-18 21:43:34 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# shellcheck disable=SC2016
|
|
|
|
#
|
|
|
|
# Components must use the `Link` component from `webutil/Link.js` rather
|
|
|
|
# than raw `<a>` elements. The `Link` component properly handles
|
|
|
|
# client-side routing, as well as providing consistent styles.
|
|
|
|
#
|
|
|
|
# See <https://github.com/sourcecred/sourcecred/pull/1305> for an
|
|
|
|
# example of how to fix this error.
|
|
|
|
|
|
|
|
export GIT_CONFIG_NOSYSTEM=1
|
|
|
|
export GIT_ATTR_NOSYSTEM=1
|
|
|
|
|
|
|
|
# shellcheck disable=SC2034
|
|
|
|
test_description='check that bare <a> elements are never directly used'
|
|
|
|
|
|
|
|
# shellcheck disable=SC1091
|
|
|
|
. ./sharness.sh
|
|
|
|
|
|
|
|
# shellcheck disable=SC1004
|
|
|
|
test_expect_success "application components must use <Link> instead of <a>" '
|
|
|
|
test_must_fail git grep -nF "</a>" \
|
|
|
|
":/src/*.js" \
|
|
|
|
":(exclude,top)*/__snapshots__/*" \
|
|
|
|
":(exclude,top)*/snapshots/*" \
|
2019-10-11 19:36:31 +00:00
|
|
|
":(exclude,top)src/plugins/discourse/references.test.js" \
|
2019-10-18 16:56:53 +00:00
|
|
|
":(exclude,top)src/plugins/discourse/createGraph.test.js" \
|
2020-01-07 13:15:26 +00:00
|
|
|
":(exclude,top)src/plugins/initiatives/htmlTemplate.test.js" \
|
2019-08-18 21:43:34 +00:00
|
|
|
":(exclude,top)src/webutil/Link.js" \
|
|
|
|
;
|
|
|
|
'
|
|
|
|
|
|
|
|
test_done
|
|
|
|
|
|
|
|
# vim: ft=sh
|