Skip to content

Commit

Permalink
fix: fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethcassel committed Sep 16, 2021
1 parent ef07f3a commit 15a0dd0
Show file tree
Hide file tree
Showing 23 changed files with 151 additions and 102 deletions.
2 changes: 1 addition & 1 deletion .eslintcache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"/Users/kennethcassel/slip/wasm-run/example/src/App.test.tsx":"1","/Users/kennethcassel/slip/wasm-run/example/src/App.tsx":"2","/Users/kennethcassel/slip/wasm-run/example/src/index.tsx":"3","/Users/kennethcassel/slip/wasm-run/example/src/react-app-env.d.ts":"4","/Users/kennethcassel/slip/wasm-run/example/src/reportWebVitals.ts":"5","/Users/kennethcassel/slip/wasm-run/example/src/setupTests.ts":"6","/Users/kennethcassel/slip/wasm-run/lib/cjs/index.js":"7","/Users/kennethcassel/slip/wasm-run/lib/esm/index.js":"8"},{"size":273,"mtime":1631826131482,"results":"9","hashOfConfig":"10"},{"size":237,"mtime":1631827909755,"results":"11","hashOfConfig":"10"},{"size":500,"mtime":1631826131483,"results":"12","hashOfConfig":"10"},{"size":40,"mtime":1631826136013,"results":"13","hashOfConfig":"10"},{"size":425,"mtime":1631826131483,"results":"14","hashOfConfig":"10"},{"size":241,"mtime":1631826131483,"results":"15","hashOfConfig":"10"},{"size":503,"mtime":1631827732531,"results":"16","hashOfConfig":"17"},{"size":252,"mtime":1631827730165,"results":"18","hashOfConfig":"17"},{"filePath":"19","messages":"20","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1dkp7er",{"filePath":"21","messages":"22","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"23","messages":"24","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"25","messages":"26","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"27","messages":"28","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"29","messages":"30","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"31","messages":"32","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1xxoj97",{"filePath":"33","messages":"34","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/kennethcassel/slip/wasm-run/example/src/App.test.tsx",[],"/Users/kennethcassel/slip/wasm-run/example/src/App.tsx",[],"/Users/kennethcassel/slip/wasm-run/example/src/index.tsx",[],"/Users/kennethcassel/slip/wasm-run/example/src/react-app-env.d.ts",[],"/Users/kennethcassel/slip/wasm-run/example/src/reportWebVitals.ts",[],"/Users/kennethcassel/slip/wasm-run/example/src/setupTests.ts",[],"/Users/kennethcassel/slip/wasm-run/lib/cjs/index.js",[],"/Users/kennethcassel/slip/wasm-run/lib/esm/index.js",[]]
[{"/Users/kennethcassel/slip/wasm-run/example/src/App.test.tsx":"1","/Users/kennethcassel/slip/wasm-run/example/src/App.tsx":"2","/Users/kennethcassel/slip/wasm-run/example/src/index.tsx":"3","/Users/kennethcassel/slip/wasm-run/example/src/react-app-env.d.ts":"4","/Users/kennethcassel/slip/wasm-run/example/src/reportWebVitals.ts":"5","/Users/kennethcassel/slip/wasm-run/example/src/setupTests.ts":"6","/Users/kennethcassel/slip/wasm-run/lib/cjs/index.js":"7","/Users/kennethcassel/slip/wasm-run/lib/esm/index.js":"8","/Users/kennethcassel/slip/wasm-run/src/index.tsx":"9","/Users/kennethcassel/slip/wasm-run/commitlint.config.js":"10","/Users/kennethcassel/slip/wasm-run/.eslintrc.js":"11"},{"size":266,"mtime":1631830539170,"results":"12","hashOfConfig":"13"},{"size":232,"mtime":1631830539170,"results":"14","hashOfConfig":"13"},{"size":493,"mtime":1631830539170,"results":"15","hashOfConfig":"13"},{"size":40,"mtime":1631826136013,"results":"16","hashOfConfig":"13"},{"size":416,"mtime":1631830539171,"results":"17","hashOfConfig":"13"},{"size":240,"mtime":1631830539171,"results":"18","hashOfConfig":"13"},{"size":499,"mtime":1631828279481,"results":"19","hashOfConfig":"20"},{"size":264,"mtime":1631828279481,"results":"21","hashOfConfig":"20"},{"size":207,"mtime":1631830547355,"results":"22","hashOfConfig":"23"},{"size":66,"mtime":1631830539170,"results":"24","hashOfConfig":"23"},{"size":387,"mtime":1631830591252,"results":"25","hashOfConfig":"23"},{"filePath":"26","messages":"27","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"o9lio9",{"filePath":"28","messages":"29","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"30","messages":"31","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"32","messages":"33","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"34","messages":"35","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"36","messages":"37","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"38","messages":"39","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1xxoj97",{"filePath":"40","messages":"41","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"42","messages":"43","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":1,"source":null},"5140dk",{"filePath":"44","messages":"45","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"46","messages":"47","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/kennethcassel/slip/wasm-run/example/src/App.test.tsx",[],"/Users/kennethcassel/slip/wasm-run/example/src/App.tsx",[],"/Users/kennethcassel/slip/wasm-run/example/src/index.tsx",[],"/Users/kennethcassel/slip/wasm-run/example/src/react-app-env.d.ts",[],"/Users/kennethcassel/slip/wasm-run/example/src/reportWebVitals.ts",[],"/Users/kennethcassel/slip/wasm-run/example/src/setupTests.ts",[],"/Users/kennethcassel/slip/wasm-run/lib/cjs/index.js",[],"/Users/kennethcassel/slip/wasm-run/lib/esm/index.js",[],"/Users/kennethcassel/slip/wasm-run/src/index.tsx",["48","49"],"/Users/kennethcassel/slip/wasm-run/commitlint.config.js",[],"/Users/kennethcassel/slip/wasm-run/.eslintrc.js",[],{"ruleId":"50","severity":1,"message":"51","line":3,"column":17,"nodeType":"52","messageId":"53","endLine":13,"endColumn":2,"fix":"54"},{"ruleId":"55","severity":1,"message":"56","line":15,"column":1,"nodeType":"57","endLine":15,"endColumn":23},"react/function-component-definition","Function component is not a function declaration","ArrowFunctionExpression","function-declaration",{"range":"58","text":"59"},"import/no-default-export","Prefer named exports.","ExportDefaultDeclaration",[27,182],"function RunWasm({\n language,\n code,\n}: {\n language: string\n code: string\n}): JSX.Element {\n return <div>\n Run {language} and execute {code}\n </div>\n}"]
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib/*
1 change: 0 additions & 1 deletion .eslintrc

This file was deleted.

15 changes: 15 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
extends: 'galex',
rules: {
'new-cap': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'import/dynamic-import-chunkname': 'off',
'prefer-destructuring': 'off',
'import/order': 'off',
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
},
env: {
jest: true,
},
}
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
Empty file modified .husky/commit-msg
100644 → 100755
Empty file.
Empty file modified .husky/pre-commit
100644 → 100755
Empty file.
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"semi": false,
"arrowParens": "always",
"singleQuote": true,
"proseWrap": "never"
}
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] }
14 changes: 7 additions & 7 deletions example/src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import App from './App';
import React from 'react'
import { render, screen } from '@testing-library/react'
import App from './App'

test('renders learn react link', () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
render(<App />)
const linkElement = screen.getByText(/learn react/i)
expect(linkElement).toBeInTheDocument()
})
14 changes: 7 additions & 7 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from "react";
import RunWasm from "run-wasm";
import "./App.css";
import React from 'react'
import RunWasm from 'run-wasm'
import './App.css'

function App() {
return (
<div className='App'>
<RunWasm language='Python' code="print('hello world')" />
<div className="App">
<RunWasm language="Python" code="print('hello world')" />
</div>
);
)
}

export default App;
export default App
14 changes: 7 additions & 7 deletions example/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import React from 'react'
import ReactDOM from 'react-dom'
import './index.css'
import App from './App'
import reportWebVitals from './reportWebVitals'

ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
)

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
reportWebVitals()
18 changes: 9 additions & 9 deletions example/src/reportWebVitals.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { ReportHandler } from 'web-vitals';
import { ReportHandler } from 'web-vitals'

const reportWebVitals = (onPerfEntry?: ReportHandler) => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
getLCP(onPerfEntry);
getTTFB(onPerfEntry);
});
getCLS(onPerfEntry)
getFID(onPerfEntry)
getFCP(onPerfEntry)
getLCP(onPerfEntry)
getTTFB(onPerfEntry)
})
}
};
}

export default reportWebVitals;
export default reportWebVitals
2 changes: 1 addition & 1 deletion example/src/setupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';
import '@testing-library/jest-dom'
10 changes: 2 additions & 8 deletions example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
Expand All @@ -20,7 +16,5 @@
"noEmit": true,
"jsx": "react-jsx"
},
"include": [
"src"
]
"include": ["src"]
}
13 changes: 8 additions & 5 deletions lib/cjs/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/// <reference types="react" />
declare const RunWasm: ({ language, code, }: {
language: string;
code: string;
}) => JSX.Element;
export default RunWasm;
declare const RunWasm: ({
language,
code,
}: {
language: string
code: string
}) => JSX.Element
export default RunWasm
34 changes: 20 additions & 14 deletions lib/cjs/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var react_1 = __importDefault(require("react"));
'use strict'
var __importDefault =
(this && this.__importDefault) ||
function (mod) {
return mod && mod.__esModule ? mod : { default: mod }
}
Object.defineProperty(exports, '__esModule', { value: true })
var react_1 = __importDefault(require('react'))
var RunWasm = function (_a) {
var language = _a.language, code = _a.code;
return (react_1.default.createElement("div", null,
"Run ",
language,
" and execute ",
code));
};
exports.default = RunWasm;
var language = _a.language,
code = _a.code
return react_1.default.createElement(
'div',
null,
'Run ',
language,
' and execute ',
code
)
}
exports.default = RunWasm
13 changes: 8 additions & 5 deletions lib/esm/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/// <reference types="react" />
declare const RunWasm: ({ language, code, }: {
language: string;
code: string;
}) => JSX.Element;
export default RunWasm;
declare const RunWasm: ({
language,
code,
}: {
language: string
code: string
}) => JSX.Element
export default RunWasm
23 changes: 14 additions & 9 deletions lib/esm/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import React from "react";
import React from 'react'
// Run Wasm
var RunWasm = function (_a) {
var language = _a.language, code = _a.code;
return (React.createElement("div", null,
"Run ",
language,
" and execute ",
code));
};
export default RunWasm;
var language = _a.language,
code = _a.code
return React.createElement(
'div',
null,
'Run ',
language,
' and execute ',
code
)
}
export default RunWasm
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"build": "yarn build:esm && yarn build:cjs",
"check-types": "tsc",
"format": "prettier --write --list-different --ignore-path .gitignore .",
"lint": "eslint --cache . --ignore-path .gitignore",
"lint": "eslint --cache . --ignore-path .gitignore --ignore-pattern 'lib/*'",
"build:esm": "tsc",
"build:cjs": "tsc --module commonjs --outDir lib/cjs",
"install:clean": "rm -rf node_modules && rm yarn.lock && yarn",
Expand Down
10 changes: 5 additions & 5 deletions src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from "react";
import React from 'react'

const RunWasm = ({
language,
code,
}: {
language: string;
code: string;
language: string
code: string
}): JSX.Element => (
<div>
Run {language} and execute {code}
</div>
);
)

export default RunWasm;
export default RunWasm
47 changes: 31 additions & 16 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,37 @@
{
"compilerOptions": {
"outDir": "lib/esm",
"module": "esnext",
"baseUrl": ".",
"paths": {
"@/components/*": ["components/*"],
"@/pages/*": ["pages/*"],
"@/constants/*": ["constants/*"],
"@/styles/*": ["styles/*"],
"@/utils/*": ["utils/*"],
"@/lib/*": ["lib/*"],
"@/types/*": ["types/*"],
"@/hooks/*": ["hooks/*"]
},
"target": "es5",
"lib": ["es6", "dom", "es2016", "es2017"],
"jsx": "react",
"declaration": true,
"moduleResolution": "node",
"noUnusedLocals": true,
"noUnusedParameters": true,
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"allowSyntheticDefaultImports": true
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
},
"include": ["src"],
"exclude": ["node_modules", "lib"]
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"components/LessonSortableItem.js",
"components/FileUploader.js",
"pages/api/stripe/webhook.ts"
],
"exclude": ["node_modules"]
}
12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,9 @@
integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==

"@types/node@*":
version "16.9.1"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.9.1.tgz#0611b37db4246c937feef529ddcc018cf8e35708"
integrity sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==
version "16.9.2"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.9.2.tgz#81f5a039d6ed1941f8cc57506c74e7c2b8fc64b9"
integrity sha512-ZHty/hKoOLZvSz6BtP1g7tc7nUeJhoCf3flLjh8ZEv1vFKBWHXcnMbJMyN/pftSljNyy0kNW/UqI3DccnBnZ8w==

"@types/normalize-package-data@^2.4.0":
version "2.4.1"
Expand Down Expand Up @@ -1217,9 +1217,9 @@ dot-prop@^5.1.0:
is-obj "^2.0.0"

electron-to-chromium@^1.3.830:
version "1.3.840"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.840.tgz#3f2a1df97015d9b1db5d86a4c6bd4cdb920adcbb"
integrity sha512-yRoUmTLDJnkIJx23xLY7GbSvnmDCq++NSuxHDQ0jiyDJ9YZBUGJcrdUqm+ZwZFzMbCciVzfem2N2AWiHJcWlbw==
version "1.3.841"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.841.tgz#c3088948462df0dea552877ad0902df6d0d55de0"
integrity sha512-0w3dJaRfl4A+LfbdvZaGT3JPm6TbTYKeJj8y5YWaEI9Z4WBNIshlzxL3S1msMGpuhiMZQE9cfgAV8oMib+Z4Tg==

emoji-regex@^8.0.0:
version "8.0.0"
Expand Down

0 comments on commit 15a0dd0

Please sign in to comment.