-
-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
450 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
extends: "@nighttrax/eslint-config-tsx", | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import { meaningOfLife } from '@nighttrax/foo'; | ||
import { meaningOfLife } from "@nighttrax/foo"; | ||
|
||
// eslint-disable-next-line no-console | ||
console.log(meaningOfLife); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
import React from "react"; | ||
|
||
export const Button = () => <button onClick={() => alert('you clicked me')}>Click me</button>; | ||
export const Button = () => ( | ||
// eslint-disable-next-line no-alert | ||
<button type="button" onClick={() => alert("you clicked me")}> | ||
Click me | ||
</button> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
config/ | ||
scripts/ | ||
src/react-app-env.d.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import {meaningOfLife} from "@nighttrax/foo"; | ||
import {Button} from "@nighttrax/components"; | ||
import { meaningOfLife } from "@nighttrax/foo"; | ||
import { Button } from "@nighttrax/components"; | ||
|
||
ReactDOM.render( | ||
<React.StrictMode> | ||
{meaningOfLife} | ||
<Button/> | ||
<Button /> | ||
</React.StrictMode>, | ||
document.getElementById('root') | ||
document.getElementById("root") | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import {meaningOfLife} from "@nighttrax/foo"; | ||
import {Button} from "@nighttrax/components"; | ||
import { meaningOfLife } from "@nighttrax/foo"; | ||
import { Button } from "@nighttrax/components"; | ||
|
||
ReactDOM.render( | ||
<React.StrictMode> | ||
{meaningOfLife} | ||
<Button/> | ||
<Button /> | ||
</React.StrictMode>, | ||
document.getElementById('root') | ||
document.getElementById("root") | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
export const meaningOfLife = 42; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
module.exports = { | ||
"presets": [ | ||
['@babel/preset-env', {targets: {node: 'current'}}], | ||
"@babel/preset-typescript" | ||
presets: [ | ||
["@babel/preset-env", { targets: { node: "current" } }], | ||
"@babel/preset-typescript", | ||
], | ||
|
||
"plugins": [ | ||
["module-resolver", { | ||
"alias": { | ||
"^@nighttrax/(.+)": "../\\1/src" | ||
} | ||
}] | ||
] | ||
} | ||
plugins: [ | ||
[ | ||
"module-resolver", | ||
{ | ||
alias: { | ||
"^@nighttrax/(.+)": "../\\1/src", | ||
}, | ||
}, | ||
], | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import {meaningOfLife} from "@nighttrax/foo"; | ||
import { meaningOfLife } from "@nighttrax/foo"; | ||
|
||
export const whatIsTheMeaningOfLife = () => meaningOfLife; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import {whatIsTheMeaningOfLife} from "../src"; | ||
import { whatIsTheMeaningOfLife } from "../src"; | ||
|
||
describe("meaning of life", function() { | ||
it("should be 42", function() { | ||
describe("meaning of life", () => { | ||
it("should be 42", () => { | ||
expect(whatIsTheMeaningOfLife()).toEqual(42); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
const { pathsToModuleNameMapper } = require('ts-jest/utils'); | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
const { pathsToModuleNameMapper } = require("ts-jest/utils"); | ||
// Load the config which holds the path aliases. | ||
const { compilerOptions } = require('../../tsconfig.json'); | ||
const { compilerOptions } = require("../../tsconfig.json"); | ||
|
||
module.exports = { | ||
preset: 'ts-jest', | ||
preset: "ts-jest", | ||
|
||
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths , { | ||
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { | ||
// This has to match the baseUrl defined in tsconfig.json. | ||
prefix: '<rootDir>/../../' | ||
}) | ||
prefix: "<rootDir>/../../", | ||
}), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import {meaningOfLife} from "@nighttrax/foo"; | ||
import { meaningOfLife } from "@nighttrax/foo"; | ||
|
||
export const whatIsTheMeaningOfLife = () => meaningOfLife; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import {whatIsTheMeaningOfLife} from "../src"; | ||
import { whatIsTheMeaningOfLife } from "../src"; | ||
|
||
describe("meaning of life", function() { | ||
it("should be 42", function() { | ||
describe("meaning of life", () => { | ||
it("should be 42", () => { | ||
expect(whatIsTheMeaningOfLife()).toEqual(42); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
const withTM = require('next-transpile-modules')( | ||
// List all of your dependencies. | ||
['components'] | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
const withTM = require("next-transpile-modules")( | ||
// List all of your dependencies. | ||
["components"] | ||
); | ||
|
||
module.exports = withTM(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import React from "react"; | ||
import {meaningOfLife} from "@nighttrax/foo"; | ||
import {Button} from "@nighttrax/components"; | ||
import { meaningOfLife } from "@nighttrax/foo"; | ||
import { Button } from "@nighttrax/components"; | ||
|
||
export default () => <div> | ||
<p>Meaning of life is {meaningOfLife}</p> | ||
<Button/> | ||
</div>; | ||
export default () => ( | ||
<div> | ||
<p>Meaning of life is {meaningOfLife}</p> | ||
<Button /> | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import {meaningOfLife} from "@nighttrax/foo"; | ||
import { meaningOfLife } from "@nighttrax/foo"; | ||
|
||
// eslint-disable-next-line no-console | ||
console.log(meaningOfLife); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
import '@nighttrax/bar'; | ||
import "@nighttrax/bar"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
const TsconfigPathsPlugin = require("tsconfig-paths-webpack-plugin"); | ||
|
||
module.exports = { | ||
entry: "./src/index.ts", | ||
mode: 'development', | ||
mode: "development", | ||
output: { | ||
filename: "bundle.js" | ||
filename: "bundle.js", | ||
}, | ||
resolve: { | ||
extensions: [".ts", ".tsx", ".js"], | ||
plugins: [new TsconfigPathsPlugin()] | ||
plugins: [new TsconfigPathsPlugin()], | ||
}, | ||
module: { | ||
rules: [ | ||
{ test: /\.tsx?$/, loader: "ts-loader" } | ||
] | ||
} | ||
rules: [{ test: /\.tsx?$/, loader: "ts-loader" }], | ||
}, | ||
}; |
Oops, something went wrong.