Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update eslint config #86

Merged
merged 1 commit into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 3 additions & 19 deletions eslint.config.mjs → eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
import js from '@eslint/js';
import globals from 'globals';

/**
* @typedef {import('eslint').Linter.FlatConfig} FlatConfig
*/

/** @type {FlatConfig[]} */
export default [
js.configs.recommended,
{
ignores: [
'.yarn/**',
'.yarnrc.yml',
'node_modules/**',
'dist/**',
'test/regression-fixtures/**',
'test/regression-diffs/**',
'test/cli/output/**',
'coverage/**',
],
ignores: ['dist/**'],
},
{
languageOptions: {
Expand All @@ -29,10 +16,7 @@ export default [
linterOptions: {
reportUnusedDisableDirectives: 'error',
},
},
js.configs.recommended,
{
files: ['**/*.js', '**/*.mjs'],
files: ['**/*.js', '**/*.cjs', '**/*.mjs'],
rules: {
strict: 'error',
},
Expand Down
2 changes: 1 addition & 1 deletion lib/stop-offset.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class StopOffsetValue extends AttValue {
}

/**
* @param {string|AttValue} value
* @param {string|import('./types.js').AttValue} value
* @returns {StopOffsetValue}
*/
static getStopOffsetObj(value) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"sax": "^1.4.1"
},
"devDependencies": {
"@eslint/js": "^9.14.0",
"@eslint/js": "^9.15.0",
"@rollup/plugin-commonjs": "^28.0.1",
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-terser": "^0.4.4",
Expand Down
4 changes: 2 additions & 2 deletions plugins/mergeGradients.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const fn = (root, params, info) => {
return;
}

const gradientId = element.attributes.id;
const gradientId = element.attributes.id.toString();
if (!gradientId) {
return;
}
Expand Down Expand Up @@ -78,7 +78,7 @@ export const fn = (root, params, info) => {
// Update all references.

addChildToDelete(childrenToDelete, duplicate);
const dupId = duplicate.attributes.id;
const dupId = duplicate.attributes.id.toString();
const dupReferencingEls = referencedIds.get(dupId);
if (!dupReferencingEls) {
continue;
Expand Down
2 changes: 2 additions & 0 deletions test/fixtures/config-loader/cjs/svgo.config.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

module.exports = {
plugins: ['cjs'],
};
2 changes: 2 additions & 0 deletions test/svgo.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

const assert = require('assert');
const {
VERSION,
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ __metadata:
languageName: node
linkType: hard

"@eslint/js@npm:9.15.0, @eslint/js@npm:^9.14.0":
"@eslint/js@npm:9.15.0, @eslint/js@npm:^9.15.0":
version: 9.15.0
resolution: "@eslint/js@npm:9.15.0"
checksum: 8b2aa35b62c1969c5e3aa5e33b4e072cc450b95ee9bc08b5a84aa5cbed10a01a9a8f0463b8bb3768ceeb5abfaa82abfb95650061338c3b467835757b62ffc4ba
Expand Down Expand Up @@ -4484,7 +4484,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "svgo-ll@workspace:."
dependencies:
"@eslint/js": ^9.14.0
"@eslint/js": ^9.15.0
"@rollup/plugin-commonjs": ^28.0.1
"@rollup/plugin-node-resolve": ^15.3.0
"@rollup/plugin-terser": ^0.4.4
Expand Down