chore: update inlang.config.js (#2542)

This commit is contained in:
Nils Jacobsen 2023-05-19 13:26:04 +02:00 committed by GitHub
parent f8f0599462
commit ca1ce8e19e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,29 +1,17 @@
// @ts-check
/**
* @type { import("@inlang/core/config").DefineConfig }
*/
export async function defineConfig(env) { export async function defineConfig(env) {
const plugin = await env.$import( const { default: pluginJson } = await env.$import(
"https://cdn.jsdelivr.net/gh/samuelstroschein/inlang-plugin-json@1.1.1/dist/index.js" 'https://cdn.jsdelivr.net/gh/samuelstroschein/inlang-plugin-json@2/dist/index.js'
); );
const { default: standardLintRules } = await env.$import( const { default: standardLintRules } = await env.$import(
"https://cdn.jsdelivr.net/gh/inlang/standard-lint-rules@1.1.1/dist/index.js" 'https://cdn.jsdelivr.net/gh/inlang/standard-lint-rules@2/dist/index.js'
); );
const pluginConfig = { return {
pathPattern: "./frontend/appflowy_flutter/assets/translations/{language}.json", referenceLanguage: 'en',
}; plugins: [pluginJson({
pathPattern: './frontend/appflowy_flutter/assets/translations/{language}.json',
return { variableReferencePattern: ["@:"]
referenceLanguage: "en", }), standardLintRules()]
languages: await plugin.getLanguages({ ...env, pluginConfig }), };
readResources: (args) => plugin.readResources({ ...args, ...env, pluginConfig }), }
writeResources: (args) => plugin.writeResources({ ...args, ...env, pluginConfig }),
lint: {
rules: [standardLintRules()],
},
};
}