Skip to content

sis0k0/clarity-migration-eslint-rules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clarity Migration ESLint Rules

Testing locally

  1. Install verdaccio globally and run it
npm install -g verdaccio
verdaccio
  1. Install the dependencies and publish the package to the local registry (verdaccio)
npm install
npm publish --registry http://localhost:4873
  1. Create a new project, navigate to it and add an .npmrc file pointing to the local registry
ng new linter-test-project
cd linter-test-project
echo registry=http://localhost:4873 >> .npmrc
  1. Install the package
# This will install the local version of the plugin because of the .npmrc config
npm install -D eslint-plugin-clarity-migration
  1. Install the other linter dependencies
npm i -D @typescript-eslint/parser eslint-html-parser eslint
  1. Add ESLint configuration for TypeScript and HTML.

.eslintrc.json

{
    "parser": "@typescript-eslint/parser",
    "parserOptions": {
        "sourceType": "module"
    },
    "plugins": ["clarity-migration"],
    "rules": {
        "clarity-migration/no-clr-button": "error"
    },
    "overrides": [
        {
            "files": ["*.html"],
            "parser": "eslint-html-parser"
        }
    ]
}
  1. Lint the project
# Lint both the TypeScript and HTML files
npx eslint --ext=ts,html src/
  1. To republish the package without bumping the version, first unpublish it from the repository:
npm unpublish --registry http://localhost:4873 eslint-plugin-clarity-migration --force

Then, publish it anew:

npm publish --registry http://localhost:4873

Demo app

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published