Skip to content

Commit

Permalink
Merge f694723 into c4833f3
Browse files Browse the repository at this point in the history
  • Loading branch information
sveyret committed Jun 3, 2020
2 parents c4833f3 + f694723 commit b20d203
Show file tree
Hide file tree
Showing 18 changed files with 271 additions and 216 deletions.
14 changes: 14 additions & 0 deletions .depcheckrc.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
detectors:
- importDeclaration
- exportDeclaration
- importCallExpression
- requireCallExpression
- requireResolveCallExpression
- typescriptImportEqualsDeclaration
- typescriptImportType
specials:
- bin
- eslint
- istanbul
- mocha
- prettier
ignores:
- '@types/node'
4 changes: 4 additions & 0 deletions .eslintrc.full.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extends:
- ./.eslintrc.yaml
rules:
import/no-cycle: error
103 changes: 65 additions & 38 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
---
env:
browser: true
shared-node-browser: true
es6: true
parser: "@typescript-eslint/parser"
es2017: true
parser: '@typescript-eslint/parser'
parserOptions:
project: tsconfig.json
sourceType: module
plugins:
- import
- prettier
settings:
jsdoc:
mode: typescript
extends:
- eslint:recommended
- plugin:node/recommended
- plugin:@typescript-eslint/eslint-recommended
- plugin:@typescript-eslint/recommended
- plugin:import/warnings
- plugin:import/typescript
- plugin:jsdoc/recommended
- plugin:prettier/recommended
- prettier
- prettier/@typescript-eslint
rules:
curly: error
Expand All @@ -33,15 +36,13 @@ rules:
- boolean
- Undefined
id-match: error
max-classes-per-file: "off"
no-bitwise: "off"
max-classes-per-file: 'off'
no-bitwise: 'off'
no-caller: error
# Keep the ability to use console, even if this should only be used for
# debuging purpose
no-console: warn
no-eval: error
no-extra-bind: error
no-invalid-this: "off"
no-invalid-this: 'off'
no-new-wrappers: error
no-restricted-syntax:
- error
Expand All @@ -56,6 +57,8 @@ rules:
no-unused-expressions:
- error
- allowShortCircuit: true
allowTernary: true
allowTaggedTemplates: true
object-shorthand: error
one-var:
- error
Expand All @@ -65,44 +68,68 @@ rules:
- allowUnboundThis: false
prefer-object-spread: error
radix: error
require-atomic-updates: "off"
require-atomic-updates: 'off'
spaced-comment: warn
valid-typeof: 'off'
space-in-parens: error
spaced-comment: error
valid-typeof: "off"
"@typescript-eslint/array-type":
'@typescript-eslint/array-type':
- error
- default: array-simple
readonly: generic
"@typescript-eslint/consistent-type-definitions": error
"@typescript-eslint/explicit-function-return-type": "off"
"@typescript-eslint/explicit-member-accessibility":
'@typescript-eslint/consistent-type-definitions': error
'@typescript-eslint/explicit-function-return-type':
- error
- allowExpressions: true
allowTypedFunctionExpressions: true
'@typescript-eslint/explicit-member-accessibility':
- error
- accessibility: explicit
"@typescript-eslint/interface-name-prefix": "off"
"@typescript-eslint/member-ordering": error
"@typescript-eslint/no-explicit-any": "off"
"@typescript-eslint/no-non-null-assertion": "off"
"@typescript-eslint/no-parameter-properties": "off"
"@typescript-eslint/no-unused-vars":
'@typescript-eslint/interface-name-prefix': 'off'
'@typescript-eslint/no-explicit-any': 'off'
'@typescript-eslint/no-non-null-assertion': 'off'
'@typescript-eslint/no-parameter-properties': 'off'
'@typescript-eslint/no-unused-vars':
- error
- argsIgnorePattern: "^_"
- argsIgnorePattern: '^_'
ignoreRestSiblings: true
"@typescript-eslint/no-use-before-define": "off"
"@typescript-eslint/prefer-for-of": error
"@typescript-eslint/prefer-function-type": error
"@typescript-eslint/unified-signatures": error
import/no-duplicates: error
import/no-extraneous-dependencies:
'@typescript-eslint/no-use-before-define':
- error
- functions: false
classes: true
enums: false
variables: false
typedefs: false
'@typescript-eslint/prefer-for-of': error
'@typescript-eslint/prefer-function-type': error
'@typescript-eslint/unified-signatures': warn
import/no-extraneous-dependencies:
- warn
- optionalDependencies: false
devDependencies:
- "**/*.spec.ts"
import/no-internal-modules: error
jsdoc/newline-after-description: error
jsdoc/no-types: error
jsdoc/require-description-complete-sentence: warn
- '**/*.spec.ts'
import/no-internal-modules: warn
import/no-self-import: error
import/order:
- warn
- groups:
- - builtin
- external
- internal
newlines-between: always
alphabetize:
order: asc
caseInsensitive: true
jsdoc/newline-after-description: warn
jsdoc/no-types: warn
jsdoc/require-description-complete-sentence:
- warn
- abbreviations:
- i.e.
- e.g.
jsdoc/require-hyphen-before-param-description: warn
jsdoc/require-jsdoc: "off"
jsdoc/require-param-type: "off"
jsdoc/require-returns-type: "off"
jsdoc/require-jsdoc: 'off'
jsdoc/require-param-type: 'off'
jsdoc/require-returns-type: 'off'
node/no-missing-import: 'off'
node/no-unsupported-features/es-syntax: 'off'
prettier/prettier: warn
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Distributable
# Binaries
node_modules/
dist/
lib/

# Coverage
.nyc_output/
Expand Down
1 change: 0 additions & 1 deletion .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
arrowParens: avoid
printWidth: 108
semi: false
Expand Down
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
language: node_js

node_js:
- '10'

- '12'
before_install:
- npm install -g coveralls

after_success:
- coveralls < ./coverage/lcov.info
branches:
only:
- master
- /^v\d+\.\d+\.\d+(-.*)?$/
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018-2020 Slune S.A.S.U.
Copyright (c) 2020 Slune

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[![npm package](https://badge.fury.io/js/intl-ts.svg)](https://www.npmjs.com/package/intl-ts)
[![license](https://img.shields.io/github/license/slune-org/intl-ts.svg)](https://github.com/slune-org/intl-ts/blob/master/LICENSE)
[![License](https://img.shields.io/github/license/slune-org/intl-ts.svg)](https://github.com/slune-org/intl-ts/blob/master/LICENSE)
[![Build Status](https://travis-ci.org/slune-org/intl-ts.svg?branch=master)](https://travis-ci.org/slune-org/intl-ts)
[![Coverage Status](https://coveralls.io/repos/github/slune-org/intl-ts/badge.svg?branch=master)](https://coveralls.io/github/slune-org/intl-ts?branch=master)
[![issues](https://img.shields.io/github/issues/slune-org/intl-ts.svg)](https://github.com/slune-org/intl-ts/issues)
[![Issues](https://img.shields.io/github/issues/slune-org/intl-ts.svg)](https://github.com/slune-org/intl-ts/issues)

# intl-ts - Type safe internationalization library

Expand All @@ -15,6 +15,14 @@ intl-ts is an i18n (internationalization) library for TypeScript. The package is

If you were using a previous version of the library, you may be interested by the [migration guide](doc/migrate.md)

# Language/langue

Documents, messages, code (including variable names and comments), are in English.

Anyway, because Slune is French firm, all documents and important messages must also be provided in French. Other translations are welcome.

:fr: Une version française de ce document se trouve [ici](doc/fr/README.md).

# Installation

Installation is done using `npm install` command:
Expand All @@ -23,20 +31,6 @@ Installation is done using `npm install` command:
$ npm install --save intl-ts
```

If you prefer using `yarn`:

```bash
$ yarn add intl-ts
```

# Language/langue

Because French is my native language, you will find all documents and messages in French. Other translations are welcome.

Anyway, because English is the language of programming, the code, including variable names and comments, are in English.

:fr: Une version française de ce document se trouve [ici](doc/fr/README.md).

# Usage

- Create your language strings (messages):
Expand Down Expand Up @@ -142,3 +136,9 @@ A new object is created when calling `LanguageMap.merge()`.

- [API documentation](doc/api.md)
- [Code examples](doc/examples.md)

# Contributing

Even though we cannot guarantee a response time, please feel free to file an issue if you have any question or problem using the package.

_Pull Requests_ are welcome. You can, of course, submit corrections or improvements for code, but do not hesitate to also improve documentation, even for small spell or grammar errors.
26 changes: 13 additions & 13 deletions doc/fr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,20 @@ intl-ts est une bibliothèque d'internationalisation (i18n) pour TypeScript. Le

Si vous utilisiez une version précédente de la bibliothèque, vous pouvez être intéressé par le [guide de migration](migrate.md)

# Installation
# Langue

L'installation se fait avec la commande `npm install` :
Les documents et messages, le code (y compris les noms de variable et commentaires), sont en anglais.

```bash
$ npm install --save intl-ts
```
Cependant, Slune étant une entreprise française, tous les documents et messages importants doivent également être fournis en français. Les autres traductions sont bienvenues.

# Installation

Si vous préférez utiliser `yarn` :
L’installation se fait avec la commande `npm install` :

```bash
$ yarn add intl-ts
$ npm install --save intl-ts
```

# Langue

Le français étant ma langue maternelle, vous trouverez tous les documents et messages en français. Les autres traductions sont bienvenues.

Cependant, l'anglais étant la langue de la programmation, le code, y compris les noms de variable et commentaires, sont en anglais.

# Utilisation

- Créez vos messages :
Expand Down Expand Up @@ -134,3 +128,9 @@ Un nouvel objet est créé lors de l'appel à `LanguageMap.merge()`.

- [Documentation de l'API](api.md)
- [Exemples de code](examples.md)

# Contribuer

Bien que nous ne puissions pas garantir un temps de réponse, n’hésitez pas à ouvrir un incident si vous avez une question ou un problème pour utiliser ce paquet.

Les _Pull Requests_ sont bienvenues. Vous pouvez bien sûr soumettre des corrections ou améliorations de code, mais n’hésitez pas également à améliorer la documentation, même pour de petites fautes d’orthographe ou de grammaire.
21 changes: 10 additions & 11 deletions examples/content/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"description": "Test package",
"main": "dist/index.js",
"scripts": {
"test": "eslint src/*.ts src/**/*.ts src/**/*.tsx",
"start": "rimraf dist && tsc && webpack-cli && node ."
},
"author": "",
Expand All @@ -19,18 +18,18 @@
"devDependencies": {
"@types/express": "^4.17.2",
"@types/glob": "^7.1.1",
"@types/node": "^13.5.0",
"@types/node": "^14.0.9",
"@types/react": "^16.9.11",
"@types/react-dom": "^16.9.4",
"@typescript-eslint/eslint-plugin": "^2.7.0",
"@typescript-eslint/parser": "^2.7.0",
"eslint": "^6.6.0",
"eslint-config-prettier": "^6.6.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-react": "^7.16.0",
"eslint-plugin-react-hooks": "^2.3.0",
"prettier": "^1.19.1",
"@typescript-eslint/eslint-plugin": "^3.1.0",
"@typescript-eslint/parser": "^3.1.0",
"eslint": "^7.1.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-react": "^7.20.0",
"eslint-plugin-react-hooks": "^4.0.4",
"prettier": "^2.0.5",
"rimraf": "^3.0.0",
"typescript": "^3.7.2",
"webpack": "^4.41.2",
Expand Down
2 changes: 1 addition & 1 deletion examples/mobx-full.diff
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ diff -Naur content/package.json mobx-full/package.json
"glob": "^7.1.6",
"intl-ts": "file:../..",
+ "mobx": "^5.15.0",
+ "mobx-react-lite": "^1.5.1",
+ "mobx-react-lite": "^2.0.7",
"react": "^16.12.0",
"react-dom": "^16.12.0"
},
Expand Down
8 changes: 4 additions & 4 deletions examples/redux-lite.diff
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ diff -Naur content/package.json redux-lite/package.json
"devDependencies": {
"@types/express": "^4.17.2",
@@ -22,6 +24,7 @@
"@types/node": "^12.12.8",
"@types/node": "^14.0.9",
"@types/react": "^16.9.11",
"@types/react-dom": "^16.9.4",
+ "@types/react-redux": "^7.1.5",
"@typescript-eslint/eslint-plugin": "^2.7.0",
"@typescript-eslint/parser": "^2.7.0",
"eslint": "^6.6.0",
"@typescript-eslint/eslint-plugin": "^3.1.0",
"@typescript-eslint/parser": "^3.1.0",
"eslint": "^7.1.0",
diff -Naur content/src/client/Language.tsx redux-lite/src/client/Language.tsx
--- content/src/client/Language.tsx 2019-11-18 21:19:48.983135633 +0100
+++ redux-lite/src/client/Language.tsx 2019-11-18 21:07:08.993866162 +0100
Expand Down

0 comments on commit b20d203

Please sign in to comment.