Skip to content

Commit

Permalink
add eslint+prettier and make work in prod setup
Browse files Browse the repository at this point in the history
  • Loading branch information
wolflu05 committed Sep 19, 2024
1 parent 8b2d609 commit 2a39936
Show file tree
Hide file tree
Showing 30 changed files with 8,299 additions and 2,626 deletions.
89 changes: 89 additions & 0 deletions inventree_template_editor/frontend/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"extends": [
"eslint:recommended",
"preact",
"plugin:react-hooks/recommended",
"plugin:import/recommended",
"plugin:jsx-a11y/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"plugins": [
"prettier",
"lingui"
],
"settings": {
"import/resolver": {
"typescript": {}
}
},
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-explicit-any": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-key": "off",
"react/self-closing-comp": "off",
"import/named": "off",
"import/no-unresolved": "error",
"import/no-named-as-default": "off",
"jsx-a11y/no-noninteractive-element-to-interactive-role": "off",
"jsx-a11y/click-events-have-key-events": "off",
"react-hooks/exhaustive-deps": "off",
"import/order": [
"error",
{
"groups": [
"builtin",
"external",
"internal",
[
"sibling",
"parent"
],
"index",
"unknown"
],
"pathGroups": [
{
"pattern": "{preact,preact/*}",
"group": "external",
"position": "before"
},
{
"pattern": "**/*.+(css|sass|less|scss|pcss|styl)",
"patternOptions": {
"dot": true,
"nocomment": true
},
"group": "unknown",
"position": "after"
},
{
"pattern": "{.,..}/**/*.+(css|sass|less|scss|pcss|styl)",
"patternOptions": {
"dot": true,
"nocomment": true
},
"group": "unknown",
"position": "after"
}
],
"warnOnUnassignedImports": true,
"distinctGroup": true,
"pathGroupsExcludedImportTypes": [],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
"lingui/no-unlocalized-strings": 0,
"lingui/t-call-in-function": 2,
"lingui/no-single-variables-to-translate": 2,
"lingui/no-expression-in-message": 2,
"lingui/no-single-tag-to-translate": 2,
"lingui/no-trans-inside-trans": 2
}
}
3 changes: 3 additions & 0 deletions inventree_template_editor/frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ dist-ssr
*.njsproj
*.sln
*.sw?

src/locales/**/messages.ts
src/locales/**/messages.po
8 changes: 8 additions & 0 deletions inventree_template_editor/frontend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"singleQuote": false,
"printWidth": 120,
"bracketSpacing": true
}
18 changes: 9 additions & 9 deletions inventree_template_editor/frontend/lingui.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/** @type {import('@lingui/conf').LinguiConfig} */
module.exports = {
locales: ["en"],
sourceLocale: "en",
catalogs: [
{
path: "<rootDir>/src/locales/{locale}/messages",
include: ["src"],
},
],
format: "po",
locales: ["en"],
sourceLocale: "en",
catalogs: [
{
path: "<rootDir>/src/locales/{locale}/messages",
include: ["src"],
},
],
format: "po",
};
Loading

0 comments on commit 2a39936

Please sign in to comment.