eslint-plugin-vue-i18n icon indicating copy to clipboard operation
eslint-plugin-vue-i18n copied to clipboard

Support for js based locales

Open stevelacey opened this issue 5 years ago • 6 comments

I switched my locale files from js to json to get the benefits of this package, there are still gaps though, for example, I build some translations dynamically out of the main set, which means I am now seeing erroneous no-missing-keys warnings, it'd be great to be able to use js-based locales

stevelacey avatar Sep 30 '19 10:09 stevelacey

After a few months the translations started to get unwieldy, so I've now broken them up into multiple json files that I stitch together with path-based rules for vue-i18n, and again I'm running into issues here, it'd be great there was an ability to supply a messages object ala vue-i18n so that I could thus construct it however I want and feed it into this plugin.

stevelacey avatar Jan 11 '20 14:01 stevelacey

Also would be nice to have typescript resources (strong type): and something like: $t(r => r.My.Resource.MyString) with IntelliSense and type check.

fairking avatar Jul 19 '20 16:07 fairking

I'm looking for support for .TS based locales. That's just one step farther from js based locales.

jagged3dge avatar Dec 17 '20 11:12 jagged3dge

Also looking for support for locales in *.ts files. It took me a while to realize it's not supported yet (mainly thanks to this issue), perhaps a sentence or two in documentation mentioning supported file types for locales might be helpful for future users.

krausvo1 avatar Aug 02 '22 09:08 krausvo1

Sharing my experience here. I also have locales in typescript files and I've been trying to figure out why I had the Cannot convert undefined or null to object error when linting. Eventually realized that the plugin could not find my locales.

I see that it's been almost 2 years, is this something supported now?

raphaelparent avatar Jun 26 '24 14:06 raphaelparent

I think you can load js locale files and lint them. However, I don't think linting to js locale files is supported.

ota-meshi avatar Jun 27 '24 00:06 ota-meshi