younesaassila / eslint-plugin-curly-quotes Goto Github PK
View Code? Open in Web Editor NEWEnforce the use of curly quotes
Home Page: https://www.npmjs.com/package/eslint-plugin-curly-quotes
License: MIT License
Enforce the use of curly quotes
Home Page: https://www.npmjs.com/package/eslint-plugin-curly-quotes
License: MIT License
Thoughts?
Thanks for creating this plugin!
I have a suggestion for avoiding warnings: typically we might use straight quotes in strings which are used as JSX properties (eg. className
) or as arguments to certain functions (eg. Error
), which we don't expect to be converted to curly quotes. I know we can use just disable the rule individually, but I believe making this configurable would be much more developer friendly.
Would you accept a PR to allow configuring JSX attributes/function names to avoid traversing?
If a string contains both single and double quotes and if the replacing curly single quote character has a length greater than 1, some double quotes might not get replaced due to textEnd
not being accurate anymore because fixedText
would have a length greater than the length of text
.
Fixable by replacing textStart
and textEnd
by some variable textTrim
that would ignore a certain amount of characters on both sides of the string (since string delimiters go in pair).
We want to allow replacing characters with a length greater than 1 because some quotation marks require spacing to be grammatically correct (e.g. guillemets in French)
In ESLint v9, the old eslintrc config format is deprecated and not enabled by default. Plugins need to migrate to the new flat configuration format. They have provided a guide for how to do so.
For this plugin, I think all that needs to change is to add a meta
key to the main entrypoint. Also, it would be helpful to export TypeScript type definitions by adding a types
field to package.json.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.