Skip to content

Commit

Permalink
chore: fix eslint warnings reported with new config version (#8705)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan authored Feb 20, 2025
1 parent 2945dbc commit b2d43f5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions packages/icons/gulpfile.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ function createCopyright() {

function iconFileModifier(prefix) {
return function (file, contents) {
const id = file.path.replace(/.*\/(.*).svg/, '$1');
const id = file.path.replace(/.*\/(.*).svg/u, '$1');
const svg = cheerio.load(contents, { xmlMode: true })('svg');
// Remove fill attributes.
svg.children('[fill]').removeAttr('fill');
// Add closing tags instead of self-closing.
const content = svg.children().toString().replace(/"\/>/g, '"></path>');
const content = svg.children().toString().replace(/"\/>/gu, '"></path>');
// Output the "meat" of the SVG as group element.
return `<g id="${prefix}${id}">${content}</g>`;
};
Expand All @@ -38,7 +38,7 @@ gulp.task('icons', () => {
.pipe(concat('vaadin-iconset.js'))
.pipe(
modify({
fileModifier(file, contents) {
fileModifier(_file, contents) {
// Enclose all icons in a vaadin-iconset
return `${createCopyright()}
import { Iconset } from '@vaadin/icon/vaadin-iconset.js';
Expand Down
4 changes: 2 additions & 2 deletions packages/rich-text-editor/gulpfile.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ template.innerHTML = \`
html {
`;
glyphs.forEach((g) => {
const name = g.name.replace(/\s/g, '-').toLowerCase();
const name = g.name.replace(/\s/gu, '-').toLowerCase();
const unicode = `\\\\${g.unicode[0].charCodeAt(0).toString(16)}`;
output += ` --${fontName}-${name}: "${unicode}";\n`;
});
Expand All @@ -71,7 +71,7 @@ document.head.appendChild(template.content);
export const iconsStyles = css\`\n`;
glyphs.forEach((g, index) => {
const name = g.name.replace(/\s/g, '-').toLowerCase();
const name = g.name.replace(/\s/gu, '-').toLowerCase();
output += ` [part~='toolbar-button-${name}']::before {
content: var(--${fontName}-${name});
}\n`;
Expand Down
8 changes: 4 additions & 4 deletions packages/vaadin-lumo-styles/gulpfile.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const svgmin = require('gulp-svgmin');
* @see http://support.ecisolutions.com/doc-ddms/help/reportsmenu/ascii_sort_order_chart.htm
*/
function sortIconFilesNormalized(file1, file2) {
return file1.replace(/-/g, '~').localeCompare(file2.replace(/-/g, '~'), 'en-US');
return file1.replace(/-/gu, '~').localeCompare(file2.replace(/-/gu, '~'), 'en-US');
}

function createCopyright() {
Expand All @@ -41,13 +41,13 @@ function createIconset(folder, filenames, idPrefix = '') {
}

const content = fs.readFileSync(folder + filename, 'utf-8');
const path = content.match(/<path( fill-rule="evenodd" clip-rule="evenodd")* d="([^"]*)"/);
const path = content.match(/<path( fill-rule="evenodd" clip-rule="evenodd")* d="([^"]*)"/u);
if (path) {
const newPath = new svgpath(path[2])
.scale(1000 / 24, 1000 / 24)
.round(0)
.toString();
const name = filename.replace('.svg', '').replace(/\s/g, '-').toLowerCase();
const name = filename.replace('.svg', '').replace(/\s/gu, '-').toLowerCase();
const attrs = path[1] !== undefined ? path[1] : '';
output += `<g id="${idPrefix}${name}"><path d="${newPath}"${attrs}></path></g>\n`;
} else {
Expand Down Expand Up @@ -166,7 +166,7 @@ const fontIcons = css\`
html {
`;
glyphs.forEach((g) => {
const name = g.name.replace(/\s/g, '-').toLowerCase();
const name = g.name.replace(/\s/gu, '-').toLowerCase();
const unicode = `\\\\${g.unicode[0].charCodeAt(0).toString(16)}`;
output += ` --lumo-icons-${name}: '${unicode}';\n`;
});
Expand Down
4 changes: 2 additions & 2 deletions packages/vaadin-material-styles/gulpfile.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const sort = require('gulp-sort');
* @see http://support.ecisolutions.com/doc-ddms/help/reportsmenu/ascii_sort_order_chart.htm
*/
function sortIconFilesNormalized(file1, file2) {
return file1.replace(/-/g, '~').localeCompare(file2.replace(/-/g, '~'), 'en-US');
return file1.replace(/-/gu, '~').localeCompare(file2.replace(/-/gu, '~'), 'en-US');
}

gulp.task('icons', (done) => {
Expand Down Expand Up @@ -104,7 +104,7 @@ const fontIcons = css\`
html {
`;
glyphs.forEach((g) => {
const name = g.name.replace(/\s/g, '-').toLowerCase();
const name = g.name.replace(/\s/gu, '-').toLowerCase();
const unicode = `\\\\${g.unicode[0].charCodeAt(0).toString(16)}`;
output += ` --material-icons-${name}: '${unicode}';\n`;
});
Expand Down
4 changes: 2 additions & 2 deletions test/integration/notification-overlay.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ describe('notification and overlays', () => {
dialog1.renderer = (root) => {
if (!root.firstChild) {
notification = document.createElement('vaadin-notification');
notification.renderer = (root) => {
root.textContent = 'Hello!';
notification.renderer = (root2) => {
root2.textContent = 'Hello!';
};

dialog2 = document.createElement('vaadin-dialog');
Expand Down

0 comments on commit b2d43f5

Please sign in to comment.