swiftally v1.0.1
swiftally
An AI-based accessibiliy linting tool forked from ESLint.
- ESLint uses Espree for JavaScript parsing.
- ESLint uses an AST to evaluate patterns in code.
- ESLint is completely pluggable, every single rule is a plugin and you can add more at runtime.
- Uses an OpenAI wrapper extension to fix the accessiblity issues based of ESlint accessibility plugins.
Installation
Prerequisites: Node.js (^18.18.0
, ^20.9.0
, or >=21.1.0
) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.)
Please install swiftally using this command. :
npm install swiftally
Along with swiftally, couple of eslint plugins needs to be installed in your project packages. Please install by running the following command. :
npm install eslint-plugin-vue-a11y --legacy-peer-deps
npm install eslint-plugin-vuejs-accessibility
Configuration
Create a config file named .swiftallyrc.js . Please run the following command :
touch .swiftallyrc.js
Place the following recommended config inside .swiftallyrc.js :
module.exports = {
root: true,
env: {
browser: true,
node: true
},
extends: [
"plugin:vue-a11y/base",
"plugin:vue-a11y/recommended",
"plugin:vuejs-accessibility/recommended"
],
plugins: ["vuejs-accessibility", "vue-a11y"]
}
Usage
Running swiftally inorder to display the accessibility issues in the console, run the following command :
swiftally --ext .vue .
If you want the accessibility issues in your application codebase fixed automatically through the integrated AI plugin, run the following :
swiftally --fix --ext .vue . .
Alternatively, you can add the following in the script property of your app's package.json;
"scripts": {
"lint": "swiftally --ext .vue .",
"lintfix": "swiftally --fix --ext .vue .",
},
And just simply run;
npm run lint
or
npm run lintfix
respectively
Disclaimer
This project is primarily derived from ESlint package authored by Nicholas C. Zakas nicholas+npm@nczconsulting.com of eslint.org. We want to clarify that our sole intention for creating this version is to extend the functionalities of this open-source project to cater to our specific needs. We acknowledge and appreciate the primal contributions made by the eslint.org community and strive to adhere to the principles of respectful and collaborative software development.
4 months ago