Fix SVG linting errors (#7551)

* Remove newlines

* Remove newline to fix test

* Enforce `lf` line endings

* Remove trailing newline enforcement

* Remove `replace` to ensure no trailing newlines

* Revert "Enforce `lf` line endings"

This reverts commit 05a13db8c33cc0dbe78318e00ff51b6412f58094.
This commit is contained in:
Tyler Miller 2022-07-04 12:47:33 -04:00 committed by GitHub
parent 4c6c4bd3b8
commit 84c0149bba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
95 changed files with 95 additions and 97 deletions

View File

@ -25,7 +25,7 @@ const htmlNamedEntities = JSON.parse(
const svglintIgnores = JSON.parse(fs.readFileSync(svglintIgnoredFile, 'utf8')); const svglintIgnores = JSON.parse(fs.readFileSync(svglintIgnoredFile, 'utf8'));
const svgRegexp = const svgRegexp =
/^<svg( [^\s]*=".*"){3}><title>.*<\/title><path d=".*"\/><\/svg>\n?$/; /^<svg( [^\s]*=".*"){3}><title>.*<\/title><path d=".*"\/><\/svg>$/;
const negativeZerosRegexp = /-0(?=[^\.]|[\s\d\w]|$)/g; const negativeZerosRegexp = /-0(?=[^\.]|[\s\d\w]|$)/g;
const iconSize = 24; const iconSize = 24;

View File

@ -61,9 +61,7 @@ export const testIcon = (icon, subject, slug) => {
}); });
it('has a valid svg value', () => { it('has a valid svg value', () => {
const svgFileContents = fs const svgFileContents = fs.readFileSync(svgPath, 'utf8');
.readFileSync(svgPath, 'utf8')
.replace(/\r?\n/, '');
assert.equal(subject.svg, svgFileContents); assert.equal(subject.svg, svgFileContents);
}); });
}); });