Skip to content

Commit

Permalink
Prevent lock file & fix lint error (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
LitoMore committed Mar 31, 2021
1 parent 8927860 commit ee41a6b
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 16 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: node_js
node_js:
- node
- 8
- 14
- 12
after_script: 'cat ./coverage/lcov.info | coveralls'
3 changes: 2 additions & 1 deletion __test__/good-type.flow.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// @flow strict
/* eslint-disable */
import * as React from 'react';
import { translate, type I18nType } from '../src';
import { translate } from '../src';
import { type I18nType } from '../src/types';
import mockI18n from '../src/mockI18n';

let result;
Expand Down
3 changes: 2 additions & 1 deletion __test__/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// @flow strict
import React from 'react';
import { mount } from 'enzyme';
import { Jed, translate, useI18n, I18nProvider, type I18nType } from '../src';
import { Jed, translate, useI18n, I18nProvider } from '../src';
import { type I18nType } from '../src/types';
import I18nContext from '../src/I18nContext';
import mockI18n from '../src/mockI18n';

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"jed": "^1.1.1"
},
"peerDependencies": {
"react": "^16.8.4"
"react": "16.x"
},
"devDependencies": {
"@babel/cli": "^7.2.3",
Expand Down Expand Up @@ -54,7 +54,6 @@
"lint-staged": "^8.1.0",
"prettier": "^1.15.2",
"react": "^16.8.4",
"react-addons-test-utils": "^15.6.2",
"react-dom": "^16.8.4"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/I18nContext.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @flow
import * as React from 'react';
import { type I18nType } from '.';
import { type I18nType } from './types';
import mockI18n from './mockI18n';

const I18nContext: React.Context<I18nType> = React.createContext(mockI18n);
Expand Down
2 changes: 1 addition & 1 deletion src/I18nProvider.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @flow
import * as React from 'react';
import { type I18nType } from '.';
import { type I18nType } from './types';
import I18nContext from './I18nContext';

const I18nProvider = ({ i18n, children }: { i18n: I18nType, children?: React.Node }) => (
Expand Down
8 changes: 0 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,4 @@ import I18nProvider from './I18nProvider';
import translate from './translate';
import { useI18n } from './I18nContext';

export type I18nType = {
lang: string,
gettext: string => string,
pgettext: (string, string) => string,
ngettext: (string, string, number) => string,
npgettext: (string, string, string, number) => string,
};

export { I18nProvider, translate, useI18n, sprintf, Jed };
2 changes: 1 addition & 1 deletion src/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable no-redeclare */
import * as React from 'react';
import hoistStatics from 'hoist-non-react-statics';
import type { I18nType } from '.';
import type { I18nType } from './types';
import { I18nContext } from './I18nProvider';

type InjectedProps = { i18n: I18nType };
Expand Down
8 changes: 8 additions & 0 deletions src/types.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// @flow
export type I18nType = {
lang: string,
gettext: string => string,
pgettext: (string, string) => string,
ngettext: (string, string, number) => string,
npgettext: (string, string, string, number) => string,
};

0 comments on commit ee41a6b

Please sign in to comment.