Skip to content

Commit

Permalink
chore: update eslint config (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkenny54 authored Nov 16, 2024
1 parent 339f2e3 commit 5327763
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 25 deletions.
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

0 comments on commit 5327763

Please sign in to comment.