forked from OpenSlides/ngx-translate-extract
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Accommodate marker pipe, directive and forks (bartholomej#5)
* fix(pipe-parser) search for pipe in structural directives * refactor(pipe-parser) simplify handling of pipes in getTranslatablesFromAst remove expressionIsOrHasBindingPipe - previously this also handled cases like `'World' | translate | upper`, but it's not actually needed, getTranslatablesFromAst can deal with it by itself move checks for translate and non-translate pipes together under a common BindingPipe check. * fix(pipe-parser): find usages of translate pipe in arguments of other pipes * feat(pipe): accommodate marker directive * feat(pipe): accommodate forks of marker fn * feat(pipe): accommodate marker pipe * chore: initial commit after fork * fix: fixed some botched imports * chore: editorconfig, refactoring and bump * chore: fixed some botched imports * re-add --marker option -m or --marker is an old option that was in biesbjerg/ngx-translate-extract it was removed and replaced by the ngx-extract-translate-marker mechanism but this new mechanism does not allow to easily customize what the marker function does (some users have use cases where this is not a no-op) * Create node.js.yml * chore: update changelog, readme and bump version * chore: busywork in prep for the lib to move back into vendure's fork --------- Co-authored-by: P4 <969645+P4@users.noreply.github.com> Co-authored-by: Christer Olsen <christer.olsen@husbanken.no> Co-authored-by: Thomas Mijieux <thomas.mijieux@aum.bio>
- Loading branch information
1 parent
6455593
commit 63eeffd
Showing
33 changed files
with
9,017 additions
and
2,267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Editor configuration, see https://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 4 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.ts] | ||
quote_type = single | ||
|
||
[*.md] | ||
max_line_length = off | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,229 @@ | ||
{ | ||
"env": { | ||
"browser": true, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"project": "tsconfig.json", | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"eslint-plugin-import", | ||
"@typescript-eslint", | ||
"@typescript-eslint/tslint" | ||
], | ||
"root": true, | ||
"rules": { | ||
"@typescript-eslint/consistent-type-definitions": "error", | ||
"@typescript-eslint/dot-notation": "off", | ||
"@typescript-eslint/explicit-member-accessibility": [ | ||
"off", | ||
{ | ||
"accessibility": "explicit" | ||
} | ||
], | ||
"@typescript-eslint/indent": [ | ||
"error", | ||
"tab" | ||
], | ||
"@typescript-eslint/member-delimiter-style": [ | ||
"error", | ||
{ | ||
"multiline": { | ||
"delimiter": "semi", | ||
"requireLast": true | ||
}, | ||
"singleline": { | ||
"delimiter": "semi", | ||
"requireLast": false | ||
} | ||
} | ||
], | ||
"@typescript-eslint/member-ordering": "error", | ||
"@typescript-eslint/naming-convention": [ | ||
"error", | ||
{ | ||
"selector": "variable", | ||
"format": [ | ||
"camelCase", | ||
"UPPER_CASE", | ||
"PascalCase" | ||
], | ||
"leadingUnderscore": "forbid", | ||
"trailingUnderscore": "forbid" | ||
} | ||
], | ||
"@typescript-eslint/no-empty-function": "off", | ||
"@typescript-eslint/no-empty-interface": "error", | ||
"@typescript-eslint/no-inferrable-types": [ | ||
"off", | ||
{ | ||
"ignoreParameters": true | ||
} | ||
], | ||
"@typescript-eslint/no-misused-new": "error", | ||
"@typescript-eslint/no-non-null-assertion": "error", | ||
"@typescript-eslint/no-shadow": [ | ||
"error", | ||
{ | ||
"hoist": "all" | ||
} | ||
], | ||
"@typescript-eslint/no-unused-expressions": "error", | ||
"@typescript-eslint/prefer-function-type": "error", | ||
"@typescript-eslint/quotes": [ | ||
"error", | ||
"single" | ||
], | ||
"@typescript-eslint/semi": [ | ||
"error", | ||
"always" | ||
], | ||
"@typescript-eslint/type-annotation-spacing": "error", | ||
"@typescript-eslint/unified-signatures": "error", | ||
"arrow-body-style": "error", | ||
"arrow-parens": [ | ||
"off", | ||
"always" | ||
], | ||
"brace-style": [ | ||
"error", | ||
"1tbs" | ||
], | ||
"comma-dangle": "off", | ||
"constructor-super": "error", | ||
"curly": "error", | ||
"dot-notation": "off", | ||
"eol-last": "error", | ||
"eqeqeq": [ | ||
"error", | ||
"smart" | ||
], | ||
"guard-for-in": "error", | ||
"id-denylist": [ | ||
"error", | ||
"any", | ||
"Number", | ||
"number", | ||
"String", | ||
"string", | ||
"Boolean", | ||
"boolean", | ||
"Undefined", | ||
"undefined" | ||
], | ||
"id-match": "error", | ||
"import/no-deprecated": "warn", | ||
"indent": "off", | ||
"linebreak-style": "off", | ||
"max-len": [ | ||
"error", | ||
{ | ||
"code": 220 | ||
} | ||
], | ||
"new-parens": "off", | ||
"newline-per-chained-call": "off", | ||
"no-bitwise": "error", | ||
"no-caller": "error", | ||
"no-console": [ | ||
"error", | ||
{ | ||
"allow": [ | ||
"log", | ||
"warn", | ||
"dir", | ||
"timeLog", | ||
"assert", | ||
"clear", | ||
"count", | ||
"countReset", | ||
"group", | ||
"groupEnd", | ||
"table", | ||
"dirxml", | ||
"error", | ||
"groupCollapsed", | ||
"Console", | ||
"profile", | ||
"profileEnd", | ||
"timeStamp", | ||
"context" | ||
] | ||
} | ||
], | ||
"no-debugger": "error", | ||
"no-empty": "off", | ||
"no-empty-function": "off", | ||
"no-eval": "error", | ||
"no-extra-semi": "off", | ||
"no-fallthrough": "error", | ||
"no-irregular-whitespace": "off", | ||
"no-multiple-empty-lines": "off", | ||
"no-new-wrappers": "error", | ||
"no-shadow": "off", | ||
"no-throw-literal": "error", | ||
"no-trailing-spaces": "error", | ||
"no-undef-init": "error", | ||
"no-underscore-dangle": "error", | ||
"no-unused-expressions": "off", | ||
"no-unused-labels": "error", | ||
"no-var": "error", | ||
"padded-blocks": [ | ||
"off", | ||
{ | ||
"blocks": "never" | ||
}, | ||
{ | ||
"allowSingleLineBlocks": true | ||
} | ||
], | ||
"prefer-const": "error", | ||
"quote-props": "off", | ||
"quotes": "off", | ||
"radix": "error", | ||
"react/jsx-curly-spacing": "off", | ||
"react/jsx-equals-spacing": "off", | ||
"react/jsx-tag-spacing": [ | ||
"off", | ||
{ | ||
"afterOpening": "allow", | ||
"closingSlash": "allow" | ||
} | ||
], | ||
"react/jsx-wrap-multilines": "off", | ||
"semi": "off", | ||
"space-before-function-paren": "off", | ||
"space-in-parens": [ | ||
"off", | ||
"never" | ||
], | ||
"spaced-comment": [ | ||
"error", | ||
"always", | ||
{ | ||
"markers": [ | ||
"/" | ||
] | ||
} | ||
], | ||
"@typescript-eslint/tslint/config": [ | ||
"error", | ||
{ | ||
"rules": { | ||
"import-spacing": true, | ||
"whitespace": [ | ||
true, | ||
"check-branch", | ||
"check-decl", | ||
"check-operator", | ||
"check-separator", | ||
"check-type" | ||
] | ||
} | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: build-test | ||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
- run: npm ci | ||
- run: npm run build --if-present | ||
- run: npm test |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
registry=https://registry.npmjs.org | ||
engine-strict=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
14 | ||
16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.