Skip to content

Commit

Permalink
Merge pull request environment-agency-austria#36 from environment-age…
Browse files Browse the repository at this point in the history
…ncy-austria/chore/update-deps-add-eslint

Chore/update deps add eslint
  • Loading branch information
maschino authored Apr 11, 2019
2 parents af78fab + 09a3b94 commit b6aaecb
Show file tree
Hide file tree
Showing 8 changed files with 1,239 additions and 757 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/*.snap
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "oceanjs"
}
15 changes: 14 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,18 @@
"editor.insertSpaces": true,
"files.encoding": "utf8",
"files.eol": "\n",
"files.insertFinalNewline": true
"files.insertFinalNewline": true,

"eslint.validate": [
"javascript",
"javascriptreact",
{
"language": "typescript",
"autoFix": true
},
{
"language": "typescriptreact",
"autoFix": true
}
]
}
47 changes: 24 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test:coverage": "jest --coverage",
"start": "rollup -c -w",
"build": "rollup -c",
"lint": "tslint -t stylish --project ."
"lint": "eslint \"src/**\""
},
"dependencies": {},
"peerDependencies": {
Expand All @@ -24,38 +24,39 @@
"react-ocean-forms": "^2.0.0"
},
"devDependencies": {
"@types/enzyme": "^3.1.18",
"@types/enzyme-adapter-react-16": "^1.0.4",
"@types/jest": "^24.0.6",
"@types/react": "^16.8.3",
"@types/enzyme": "^3.9.1",
"@types/enzyme-adapter-react-16": "^1.0.5",
"@types/jest": "^24.0.11",
"@types/react": "^16.8.13",
"@types/react-intl": "^2.3.17",
"coveralls": "^3.0.2",
"@typescript-eslint/eslint-plugin": "^1.6.0",
"@typescript-eslint/parser": "^1.6.0",
"coveralls": "^3.0.3",
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.9.1",
"enzyme-adapter-react-16": "^1.12.1",
"enzyme-to-json": "^3.3.5",
"jest": "^24.1.0",
"eslint": "^5.16.0",
"eslint-config-oceanjs": "^1.1.0",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react-hooks": "^1.6.0",
"jest": "^24.7.1",
"prop-types": "^15.7.2",
"react": "^16.8.2",
"react-dom": "^16.8.2",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-intl": "^2.8.0",
"react-ocean-forms": "^2.2.0",
"rollup": "^1.2.2",
"rollup-plugin-commonjs": "^9.2.0",
"rollup": "^1.10.0",
"rollup-plugin-commonjs": "^9.3.4",
"rollup-plugin-filesize": "^6.0.1",
"rollup-plugin-node-resolve": "^4.0.0",
"rollup-plugin-typescript2": "^0.19.2",
"ts-jest": "^24.0.0",
"rollup-plugin-node-resolve": "^4.2.3",
"rollup-plugin-typescript2": "^0.20.1",
"ts-jest": "^24.0.2",
"ts-loader": "^5.3.3",
"tslint": "^5.12.1",
"tslint-consistent-codestyle": "^1.15.0",
"tslint-eaa-contrib": "^0.1.5",
"tslint-microsoft-contrib": "^6.0.0",
"tslint-react": "^3.6.0",
"typescript": "^3.3.3"
"typescript": "^3.4.3"
},
"resolutions": {
"@types/react": "16.8.3",
"@types/enzyme": "^3.1.18"
"@types/react": "16.8.13",
"@types/enzyme": "3.9.1"
},
"files": [
"build/"
Expand Down
14 changes: 7 additions & 7 deletions src/IntlForm/IntlForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ describe('<IntlForm />', () => {
});

describe('error cases', () => {
const cases = [
[ null ],
[ undefined ],
[ '' ],
const cases: [string, null | undefined | string][] = [
[ 'null', null ],
[ 'undefined', undefined ],
[ 'empty', '' ],
];

describe.each(cases)('called with "%s"', (name: string) => {
describe.each(cases)('called with "%s"', (name, value) => {
const { intl, formatIntlString } = setup();

let consoleErrorSpy: jest.SpyInstance;
Expand All @@ -100,8 +100,8 @@ describe('<IntlForm />', () => {
});

it('should return the passed value as-is', () => {
const result = formatIntlString(name);
expect(result).toBe(name);
const result = formatIntlString(value as string);
expect(result).toBe(value);
});

it('should not call intl.formatMessage', () => {
Expand Down
2 changes: 0 additions & 2 deletions src/IntlForm/IntlForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export class BaseIntlForm extends React.Component<IIntlFormProps> {
private formatIntlString = (id: string, values?: IMessageValues): string => {
// Return the id if no valid id was given
if (id === null || id === undefined || id === '') {
// tslint:disable-next-line:no-console
console.error('[IntlForm] Invalid id given to formatIntlString');

return id;
Expand All @@ -33,7 +32,6 @@ export class BaseIntlForm extends React.Component<IIntlFormProps> {
return intl.formatMessage({ id }, values);
}

// tslint:disable-next-line:member-ordering
public render(): JSX.Element {
const {
children,
Expand Down
8 changes: 0 additions & 8 deletions tslint.json

This file was deleted.

Loading

0 comments on commit b6aaecb

Please sign in to comment.