Skip to content

Commit 1722e7d

Browse files
ESLint
TypeScript fixes Coveralls
1 parent 1158c51 commit 1722e7d

23 files changed

+216
-267
lines changed

.eslintrc

Lines changed: 14 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,28 @@
11
{
22
"extends": [
3-
"typescript",
4-
"airbnb",
5-
"prettier",
6-
"prettier/react",
7-
"prettier/standard"
8-
],
9-
"plugins": [
10-
"prettier",
11-
"react"
3+
"ringcentral-typescript"
124
],
135
"rules": {
14-
"camelcase": 0,
15-
"class-methods-use-this": 0,
16-
"dot-notation": 0,
17-
// foo['bar'] for private
18-
"global-require": 0,
19-
"indent": 0,
20-
"import/extensions": [
21-
".js",
22-
".jsx",
23-
".json",
24-
".ts",
25-
".tsx"
26-
],
27-
"import/no-extraneous-dependencies": 0,
28-
"import/no-named-as-default": 0,
29-
"import/prefer-default-export": 0,
30-
"jsx-a11y/anchor-is-valid": 0,
31-
"jsx-a11y/click-events-have-key-events": 0,
32-
"jsx-a11y/label-has-for": 0,
33-
"jsx-a11y/no-static-element-interactions": 0,
34-
"max-len": 0,
35-
"no-alert": 0,
36-
"no-bitwise": 0,
37-
"no-console": 0,
38-
"no-class-assign": 0,
39-
"no-mixed-operators": 0,
40-
"no-nested-ternary": 0,
41-
"no-param-reassign": 0,
42-
"no-plusplus": 0,
43-
"no-return-assign": 0,
44-
"no-shadow": 0,
45-
"no-underscore-dangle": 0,
46-
"no-unused-vars": 0,
47-
"no-unused-expressions": 0,
48-
// tests
49-
"no-undef": 0,
50-
//FIXME @see https://github.com/eslint/typescript-eslint-parser/issues/75
51-
"react/forbid-prop-types": 0,
52-
"react/jsx-filename-extension": 0,
53-
"react/no-array-index-key": 0,
54-
"react/no-multi-comp": 0,
55-
"react/no-unescaped-entities": 0,
56-
"react/no-unused-prop-types": 0,
57-
"react/no-unused-state": 0,
58-
"react/prop-types": 0,
59-
"react/require-default-props": 0,
60-
"spaced-comment": 0,
61-
"prettier/prettier": "error",
62-
"typescript/explicit-function-return-type": 0,
63-
"typescript/explicit-member-accessibility": 0,
64-
"typescript/member-ordering": 0,
65-
"typescript/no-var-requires": 0
66-
// conditional require in Externals
6+
"import/no-unresolved": "off", // to capture direct deps in TS
7+
"jsx-a11y/anchor-is-valid": "off", // Next.js use <a>
8+
"no-console": "off",
9+
"no-undef": "off", //FIXME @see https://github.com/eslint/typescript-eslint-parser/issues/75
10+
"no-unused-expressions": "off", // tests
11+
"react/sort-comp": "off",
12+
"react/prop-types": "off",
13+
"@typescript-eslint/no-unused-vars": "off",
14+
"@typescript-eslint/explicit-function-return-type": "off",
15+
"@typescript-eslint/no-explicit-any": "off",
16+
"@typescript-eslint/no-var-requires": "off"
6717
},
6818
"env": {
6919
"browser": true,
7020
"mocha": true,
7121
"node": true
7222
},
7323
"settings": {
74-
"import/resolver": {
75-
"node": {
76-
"extensions": [
77-
".js",
78-
".jsx",
79-
".ts",
80-
".tsx"
81-
]
82-
}
24+
"react": {
25+
"version": "16.6.0"
8326
}
84-
},
85-
"globals": { // jest-puppeteer
86-
"page": true,
87-
"browser": true,
88-
"context": true,
89-
"jestPuppeteer": true
9027
}
9128
}

.lintstagedrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"*.ts*": [
2+
"*.{ts,tsx,js,jsx}": [
33
"npm run lint --",
44
"git add"
55
]

.travis.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,24 @@ node_js:
66
before_install:
77
- npm config set //registry.npmjs.org/:_authToken=${NPM_TOKEN}
88

9+
before_script:
10+
- DEBUG=eslint:cli-engine npm run lint:all
11+
- npm run build
12+
913
deploy:
1014
#- provider: script
11-
# script: bash npm run publish:canary -- --yes
15+
# script: npm run publish:canary -- --yes
1216
# skip_cleanup: true
1317
# on:
18+
# tags: false
1419
# branch: master
1520
# repo: kirill-konshin/next-redux-wrapper
1621
- provider: script
17-
script: bash npm run publish:fromgit -- --yes
22+
script: npm run publish:fromgit -- --yes
1823
skip_cleanup: true
1924
on:
2025
tags: true
21-
repo: kirill-konshin/next-redux-wrapper
26+
repo: kirill-konshin/next-redux-wrapper
27+
28+
after_success:
29+
- npm run test:coverage

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Redux wrapper for Next.js
22
=========================
33

44
![Build status](https://travis-ci.org/kirill-konshin/next-redux-wrapper.svg?branch=master)
5+
[![Coverage Status](https://coveralls.io/repos/github/kirill-konshin/next-redux-wrapper/badge.svg?branch=master)](https://coveralls.io/github/kirill-konshin/next-redux-wrapper?branch=master)
56

67
:warning: This will work only with NextJS 6+ :warning:
78

package.json

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,36 @@
11
{
22
"name": "next-redux-wrapper-mono",
33
"private": true,
4-
"version": "2.1.0",
4+
"version": "3.0.0",
55
"description": "Redux wrapper for Next.js",
66
"main": "lib/index.js",
77
"module": "es6/index.js",
88
"types": "types/index.d.ts",
99
"scripts": {
10-
"postinstall": "lerna bootstrap --hoist",
11-
"clean": "lerna run clean && lerna clean && rimraf node_modules",
12-
"start": "lerna run start --parallel",
13-
"build": "npm run lint:all && lerna run build",
14-
"test": "lerna run build && lerna run test",
15-
"publish:canary": "lerna publish --canary --force-publish=\"*\"",
10+
"postinstall": "lerna bootstrap --hoist --no-ci",
11+
"clean": "lerna run clean && lerna clean --yes && rimraf node_modules",
12+
"start": "npm run build && lerna run start --parallel",
13+
"build": "lerna run build --concurrency=1 --stream",
14+
"test": "lerna run test --concurrency=1 --stream",
15+
"test:coverage": "cat packages/*/coverage/lcov.info | coveralls",
16+
"publish:canary": "lerna publish --canary --force-publish=*",
1617
"publish:fromgit": "lerna publish from-git",
17-
"prepare:release": "lerna version --tag-version-prefix=\"\" --force-publish=\"*\"",
18+
"prepare:release": "lerna version --tag-version-prefix='' --force-publish=*",
1819
"prepare:prerelease": "npm run prepare:release -- prerelease --preid alpha",
19-
"lint": "eslint --cache --cache-location ./node_modules/.cache/eslint --fix --quiet",
20-
"lint:all": "npm run lint -- ./packages/*/**/*.ts?",
20+
"lint": "eslint --cache --cache-location ./node_modules/.cache/eslint --fix",
21+
"lint:all": "npm run lint -- 'packages/*/**/*.ts?' 'packages/*/*.js'",
2122
"lint:staged": "lint-staged"
2223
},
2324
"devDependencies": {
24-
"eslint": "5.9.0",
25-
"eslint-config-airbnb": "17.1.0",
26-
"eslint-config-prettier": "3.3.0",
27-
"eslint-config-typescript": "1.1.0",
28-
"eslint-plugin-import": "2.14.0",
29-
"eslint-plugin-jsx-a11y": "6.1.2",
30-
"eslint-plugin-prettier": "3.0.0",
31-
"eslint-plugin-react": "7.11.1",
32-
"eslint-plugin-typescript": "0.14.0",
33-
"husky": "1.2.0",
34-
"lerna": "3.5.1",
25+
"coveralls": "3.0.2",
26+
"eslint": "5.12.1",
27+
"eslint-config-ringcentral-typescript": "0.1.0",
28+
"husky": "1.3.1",
29+
"lerna": "3.10.7",
3530
"lint-staged": "8.1.0",
36-
"prettier": "1.15.3",
37-
"rimraf": "2.6.2",
38-
"typescript": "3.2.1",
39-
"typescript-eslint-parser": "21.0.2"
31+
"prettier": "1.16.1",
32+
"rimraf": "2.6.3",
33+
"typescript": "3.2.4"
4034
},
4135
"author": "Kirill Konshin",
4236
"repository": {

packages/configs/jest.config.js

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
module.exports = {
2-
testPathIgnorePatterns: [
3-
'./node_modules'
4-
],
2+
testPathIgnorePatterns: ['./node_modules'],
53
collectCoverage: true,
6-
coveragePathIgnorePatterns: [
7-
'./node_modules',
8-
],
4+
coveragePathIgnorePatterns: ['./node_modules'],
95
transform: {
10-
'^.+\\.tsx?$': 'ts-jest'
6+
'^.+\\.tsx?$': 'ts-jest',
117
},
12-
testRegex: '/tests/.*\\.(test|spec)\\.tsx?$',
13-
moduleFileExtensions: [
14-
'ts',
15-
'tsx',
16-
'js',
17-
'jsx',
18-
'json'
19-
]
20-
};
8+
testRegex: '/(tests|src)/.*\\.(test|spec)\\.tsx?$',
9+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
10+
};

packages/configs/tsconfig.json

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{
22
"compilerOptions": {
33
"allowSyntheticDefaultImports": true,
4-
"declaration": true,
5-
"declarationDir": "types",
64
"esModuleInterop": true,
75
"experimentalDecorators": true,
86
"jsx": "react",
@@ -13,19 +11,10 @@
1311
"module": "commonjs",
1412
"moduleResolution": "node",
1513
"noImplicitAny": false,
16-
"outDir": "lib",
1714
"preserveConstEnums": true,
1815
"pretty": true,
1916
"resolveJsonModule": true,
2017
"sourceMap": true,
2118
"target": "es5"
22-
},
23-
"exclude": [
24-
"*/node_modules",
25-
"*/lib"
26-
],
27-
"include": [
28-
"src/**/*.ts",
29-
"src/**/*.tsx"
30-
]
19+
}
3120
}

packages/demo/components/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React from 'react';
1+
import React, {FunctionComponent} from 'react';
22
import {connect} from 'react-redux';
33

4-
const Layout = ({tick, toe, children}) => (
4+
const Layout: FunctionComponent<any> = ({tick, toe, children}) => (
55
<div className="layout">
66
<div>Redux tick: {tick}</div>
77
<div>Redux toe: {toe}</div>
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
module.exports = {
22
server: {
33
command: 'npm start',
4+
debug: true,
45
port: 3000,
5-
launchTimeout: 30000
6-
}
7-
};
6+
launchTimeout: 30000,
7+
},
8+
};

packages/demo/jest.config.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
const config = require('next-redux-wrapper-configs/jest.config');
22
module.exports = Object.assign({}, config, {
3-
roots: [
4-
'<rootDir>/tests'
5-
],
3+
roots: ['<rootDir>/tests'],
64
preset: 'jest-puppeteer',
75
testPathIgnorePatterns: config.testPathIgnorePatterns.concat('./.next'),
8-
coveragePathIgnorePatterns: config.coveragePathIgnorePatterns.concat('./jest-puppeteer.config.js')
9-
});
6+
coveragePathIgnorePatterns: config.coveragePathIgnorePatterns.concat('./jest-puppeteer.config.js'),
7+
});

0 commit comments

Comments
 (0)