Skip to content

Commit

Permalink
chore: bump deps (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
amilajack authored Dec 9, 2020
1 parent 3b8f6f1 commit 1cafce3
Show file tree
Hide file tree
Showing 9 changed files with 2,118 additions and 1,502 deletions.
1 change: 0 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
.*/test/.*\.example\.js

[options]
suppress_comment=.*\\$FlowIgnore
esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable
esproposal.export_star_as=enable
4 changes: 2 additions & 2 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github: amilajack
github: [amilajack]
patreon: amilajack
paypal: https://paypal.me/amilajack
custom: ['https://paypal.me/amilajack', 'https://venmo.com/amilajack']
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test

on: push

jobs:
release:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [macos-10.14, ubuntu-18.04, windows-2019]

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 14

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: yarn install
run: yarn --frozen-lockfile

- name: yarn test
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
run: yarn test
19 changes: 0 additions & 19 deletions azure-pipelines.yml

This file was deleted.

57 changes: 30 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"flow": "flow",
"build": "cross-env NODE_ENV=production babel src --out-dir dist",
"lint": "eslint --cache --format=node_modules/eslint-formatter-pretty .",
"lint": "eslint --cache .",
"prettier": "prettier --single-quote --write \"./src/*.js\"",
"preversion": "yarn build",
"spec": "yarn build && jest",
Expand All @@ -30,38 +30,41 @@
"dist"
],
"dependencies": {
"@babel/runtime": "^7.9.6",
"core-js": "3.6.5",
"find-up": "^4.1.0",
"@babel/runtime": "^7.12.5",
"core-js": "3.8.1",
"find-up": "^5.0.0",
"slash": "^3.0.0"
},
"devDependencies": {
"@babel/cli": "^7.8.4",
"@babel/core": "^7.9.6",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/preset-env": "^7.9.6",
"@babel/preset-flow": "^7.9.0",
"@babel/register": "^7.9.0",
"@babel/cli": "^7.12.8",
"@babel/core": "^7.12.9",
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/preset-env": "^7.12.7",
"@babel/preset-flow": "^7.12.1",
"@babel/register": "^7.12.1",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.0.1",
"babel-jest": "^26.6.3",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"cross-spawn": "^7.0.2",
"eslint": "7.0.0",
"eslint-config-airbnb-base": "^14.1.0",
"eslint-config-prettier": "^6.11.0",
"eslint-formatter-pretty": "^3.0.1",
"eslint-plugin-flowtype": "^5.0.3",
"eslint-plugin-html": "^6.0.2",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-vue": "^6.2.2",
"execa": "^4.0.1",
"flow-bin": "0.125.1",
"husky": "^4.2.5",
"jest-cli": "^26.0.1",
"prettier": "^2.0.5"
"cross-env": "^7.0.3",
"cross-spawn": "^7.0.3",
"eslint": "7.15.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-prettier": "^7.0.0",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-html": "^6.1.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-prettier": "^3.2.0",
"eslint-plugin-vue": "^7.2.0",
"execa": "^5.0.0",
"flow-bin": "0.139.0",
"husky": "^4.3.5",
"jest-cli": "^26.6.3",
"lint-staged": "^10.5.3",
"prettier": "^2.2.1"
},
"lint-staged": {
"*.js": ["eslint", "prettier --write"]
},
"peerDependencies": {
"eslint": ">=5.16.0",
Expand Down
18 changes: 10 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ type EslintContext = {
options: any[],
};

type ReturnRule = { Program: (node: Object) => void }

type Info = {
flowDir: string,
program: Program,
Expand Down Expand Up @@ -103,8 +105,8 @@ function errorFlowCouldNotRun(loc) {
};
}

function createFilteredErrorRule(filter: (CollectOutputElement) => any) {
return function showErrors(context: EslintContext) {
function createFilteredErrorRule(filter: (CollectOutputElement) => any): (context: EslintContext) => ReturnRule {
return function showErrors(context: EslintContext): ReturnRule {
return {
Program(node: Object) {
const source = context.getSourceCode();
Expand Down Expand Up @@ -187,7 +189,7 @@ export default {
recommended,
},
rules: {
uncovered: function showCoverage(context: EslintContext) {
uncovered: function showCoverage(context: EslintContext): ReturnRule {
return {
Program(node: Object) {
const res = getCoverage(context, node);
Expand All @@ -213,7 +215,7 @@ export default {
},
'enforce-min-coverage': function enforceMinCoverage(
context: EslintContext
) {
): ReturnRule {
return {
Program(node: Object) {
const res = getCoverage(context, node);
Expand All @@ -240,11 +242,11 @@ export default {
},
};
},
'show-errors': createFilteredErrorRule(
'show-errors': (createFilteredErrorRule(
({ level }) => level !== FlowSeverity.Warning
),
'show-warnings': createFilteredErrorRule(
) : (context: EslintContext) => ReturnRule),
'show-warnings': (createFilteredErrorRule(
({ level }) => level === FlowSeverity.Warning
),
) : (context: EslintContext) => ReturnRule),
},
};
4 changes: 2 additions & 2 deletions test/9.example.import.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
/**
* @flow
*/
import React from 'react';
import * as React from 'react'

export default function Hello({ name = 'World' }: { name: string }) {
export default function Hello({ name = 'World' }: { name: string }): React.Node {
return <p>Hello, {name}!</p>;
}
Loading

0 comments on commit 1cafce3

Please sign in to comment.