Tags: simple-icons/svglint
Tags
feat: lint SVG from stdin (#82) Extend the CLI to support providing an SVG on `stdin` [1]. The CLI will only do this when provided with the `--stdin` flag, I choose this design as it was the only reliable way of switching between files and stdin I could find. Despite the awkward diff, the CLI flow for files (i.e. if `--stdin` is not used) is unchanged. The stdin flow is based on [2] and just calls the JS API's `lintSource` function on the entire input. -- 1. https://nodejs.org/api/process.html#processstdin 2. https://nodejs.org/api/stream.html#readablereadsize
fix: support running CLI in project without config file (#80) * Test behavior when no configuration file is present Update the CLI tests to include a test for the case where a project does not have a configuration file. This test currently fails because this is currently not supported due to a bug introduced in v2.2.0. To accommodate testing this, the configuration file that was present at the root of the project has been moved and related tests updated accordingly. This is necessary because svglint automatically searches for a configuration file up the file tree, so having a configuration file at the root of the project makes it impossible to test the scenario The new tests matches against a string because unfortunately the error is silent - it doesn't exit with a non-zero exit code. Improvements to this are welcome as contributions. * Support no configuration file for the CLI Update the CLI to work if no configuration file is found. This is the simplest fix I could think of. Theoretically the problem could be addressed in the API (svglint.js line 137 and 150) by replacing the default parameter `config={}` with an implementation that defaults to an empty object for both `undefined` **and** `null`. However, it's currently not clear that's the right move. Another alternative would be for `loadConfigurationFile` to return `undefined` instead of `null`. However, that could interfere with the intended behavior of that function, making it impossible to distinguish a missing default export from no-configuration-file-found.
chore: bump the version of the lockfile from v1 to v3 (#67) * bump lockfile-version from v1 to v3 * bump Node.js runtime used in CI Update the Node.js runtime used in CI jobs to 18. Correspondingly, this will install a more recent version of npm, one with support for lockfile version 3. * install specific npm version for test jobs in CI The test jobs need to run on various Node.js version, including some older version. To ensure there's an npm version available that supports lockfile v3, install a specific version of npm manually. Specifically the lowest v8 release that supports it. * bump lowest Node.js version tested in CI While 12.20.0 and 14.13.1 are still supported by this package, some dependencies minimum required version is 12.22.0 and 14.17.0 (resp.). I don't expect these couple of minor bumps in Node.js version to cause a com 3DAD patibility issue in this project, so as a quick solution I'm bumping the tested versions to match the lowest supported Node.js versions by dependencies.
PreviousNext