pa11y / pa11y-ci

Pa11y CI is a CI-centric accessibility test runner, built using Pa11y
https://pa11y.org
GNU Lesser General Public License v3.0
509 stars 62 forks source link

Add support for `.cjs` extension #240

Open na2axl opened 2 months ago

na2axl commented 2 months ago

Hey there,

I just added a small change to add support for .cjs extensions. I think for most modern Javascript projects we use ES6 modules instead for CommonJS, so even for frameworks such as SvelteKit (what we use in our company) or Next.js the default setting for .js files is module (defined in package.json). In such cases, we usually use .cjs extension for CommonJS files.

I was unable to run pa11y-ci with a custom config other than a JSON file because it was not allowing me to use a .js file and the .cjs extension was not recognized.

With the provided change, I can run pa11y in our project.