Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

feat(global): try TS workflow#1013

Merged
mydearxym merged 23 commits intodevfromts-workflow
Mar 11, 2021
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
23 commits
Select commitHold shift + click to select a range
d8f82fe
chore(ts-workflow): basic setup
mydearxymMar 9, 2021
5ad0fa9
chore(ts-workflow): testId -> testid to avoid warning
mydearxymMar 9, 2021
65445d9
chore(ts-workflow): resolve type warnings
mydearxymMar 9, 2021
ddf62c8
chore(ts-workflow): rename _app
mydearxymMar 9, 2021
828661c
chore(ts-workflow): basic lint & rules setup
mydearxymMar 10, 2021
531504e
chore(ts-workflow): logic & store with ts support && rules adjust
mydearxymMar 10, 2021
11cce16
chore(ts-workflow): tsx test
mydearxymMar 10, 2021
28dfbf9
chore(ts-workflow): add tsc check, resolve errors
mydearxymMar 10, 2021
eabb977
chore(ts-workflow): add tsc check, resolve errors
mydearxymMar 10, 2021
d80fb87
fix(ts-workflow): rootStore TS hint
mydearxymMar 10, 2021
ceb8381
refactor(ts-workflow): generator container store.js -> store.ts
mydearxymMar 10, 2021
a669789
refactor(ts-workflow): cycle import issue doc
mydearxymMar 10, 2021
fedcbe1
refactor(ts-workflow): generator logic.js -> logic.ts
mydearxymMar 10, 2021
1c3e13a
refactor(ts-workflow): generator index.js && styles.js to ts version
mydearxymMar 10, 2021
d0eaa7d
chore(ts-workflow): styles/*.js -> ts && resolve error/warning
mydearxymMar 10, 2021
0a1bbd7
chore(ts-workflow): more styles/*.js -> ts && resolve error/warning
mydearxymMar 10, 2021
cdb48b2
chore(ts-workflow): more styles/*.js -> ts && resolve error/warning
mydearxymMar 10, 2021
1c3ea7d
chore(ts-workflow): resolve type warning
mydearxymMar 10, 2021
7ac1fc2
chore(ts-workflow): more js -> ts
mydearxymMar 11, 2021
0f4ed4b
ci(actions): use offical elixir action
mydearxymMar 11, 2021
685d483
fix(build): missing style error
mydearxymMar 11, 2021
eeaa6fc
chore(ts-workflow): utils js -> ts
mydearxymMar 11, 2021
d2e0c2c
fix(ts-workflow): type warnings
mydearxymMar 11, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions.eslintignore
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
!.eslintrc.js
.gitignore
*.json
*.lock
*.hbs
33 changes: 30 additions & 3 deletions.eslintrc.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
// see details:
// https://github.com/groupher/eslint-config-web/blob/master/index.js
module.exports = {
extends: ['@groupher/eslint-config-web'],
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: [
'@groupher/eslint-config-web',
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
],
// extends: ['@groupher/eslint-config-web'],
settings: {
// see if the import lib exsit or not
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
'babel-module': {},
'eslint-import-resolver-custom-alias': {
Expand All@@ -14,20 +26,35 @@ module.exports = {
'@/constant': 'utils/constant',
'@/hooks': 'src/hooks',
'@/hoc': 'src/hoc',
'@/config': 'config',
'@/stores': 'src/stores',
'@/model': 'src/stores/SharedModel',
'@/utils': 'utils',
'@/schemas': 'src/schemas',
'@/Img': 'src/components/Img',
'@/SvgIcons': 'src/components/SvgIcons',
'@/i18n': 'i18n',
'@/types': 'src/types',
},
extensions: ['.js', '.jsx'],
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
rules: {
'@typescript-eslint/ban-ts-comment': 0,
'react/jsx-filename-extension': [
2,
{ extensions: ['.js', '.jsx', '.ts', '.tsx'] },
],
'import/no-named-as-default': 0,
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
},
}
2 changes: 1 addition & 1 deletion.github/workflows/ci.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -29,7 +29,7 @@ jobs:
repository: 'coderplanets/coderplanets_server'
path: 'backend_server'
- name: (Backend) Setup Elixir and OTP
uses:actions/setup-elixir@v1
uses:erlef/setup-elixir@v1
with:
elixir-version: '1.10.3' # Define the elixir version [required]
otp-version: '22.3' # Define the OTP version [required]
Expand Down
1 change: 1 addition & 0 deletions.gitignore
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,3 +13,4 @@ cypress/videos/
.vscode/
.DS_Store
report.*
.eslintcache
2 changes: 2 additions & 0 deletionsnext-env.d.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
/// <reference types="next" />
/// <reference types="next/types/global" />
10 changes: 7 additions & 3 deletionspackage.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -22,8 +22,8 @@
"clean": "shjs ./utils/scripts/clean.js",
"gen": "plop --plopfile ./utils/scripts/generators/index.js",
"analyze": "cross-env ANALYZE=true next build",
"lint": "./node_modules/.bin/eslint --ext .js --fix src/ utils/",
"lint:staged": "git diff --cached --name-only --diff-filter=ACRM |grep \".js$\" |xargs ./node_modules/.bin/eslint --ext .js",
"lint": "./node_modules/.bin/eslint --ext .js,.ts,.tsx --fix src/ utils/",
"lint:staged": "git diff --cached --name-only --diff-filter=ACRM | xargs ./node_modules/.bin/eslint --cache --ext .js,.ts,.tsx && tsc --noemit",
"test": "cross-env NODE_ENV=test jest --config .jest.config.js",
"test:dev": "cross-env NODE_ENV=test jest --config .jest.config.js",
"test:watch": "npm run test -- --watch",
Expand DownExpand Up@@ -140,6 +140,9 @@
"@commitlint/cli": "^8.2.0",
"@commitlint/config-conventional": "^8.2.0",
"@groupher/eslint-config-web": "2.0.9",
"@types/ramda": "^0.27.38",
"@typescript-eslint/eslint-plugin": "^4.17.0",
"@typescript-eslint/parser": "^4.17.0",
"babel-eslint": "^10.0.2",
"babel-jest": "^23.6.0",
"bundlewatch": "^0.2.7",
Expand All@@ -160,6 +163,7 @@
"react-test-renderer": "16.10.0",
"shelljs": "0.8.4",
"standard-version": "^8.0.1",
"start-server-and-test": "1.10.1"
"start-server-and-test": "1.10.1",
"typescript": "^4.2.3"
}
}
2 changes: 1 addition & 1 deletionsrc/components/AlertBar/index.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,7 @@ import { Wrapper } from './styles'
const log = buildLog('c:AlertBar:index')

const AlertBar = ({ children }) => {
return <WrappertestId="alertBar">{children}</Wrapper>
return <Wrappertestid="alertBar">{children}</Wrapper>
}

AlertBar.propTypes = {
Expand Down
2 changes: 1 addition & 1 deletionsrc/components/AlertBar/styles/index.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,7 +4,7 @@ import styled from 'styled-components'
// import { theme } from '@/utils'

export const Wrapper = styled.div.attrs((props) => ({
'data-test-id': props.testId,
'data-test-id': props.testid,
}))`
font-size: 14px;
font-variant: tabular-nums;
Expand Down
8 changes: 4 additions & 4 deletionssrc/components/Buttons/NotifyButton/index.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,9 +25,9 @@ import {
/* eslint-disable-next-line */
const log = buildLog('c:NotifyButton:index')

const NotifyButton = ({testId, subscribed }) => {
const NotifyButton = ({testid, subscribed }) => {
return (
<WrappertestId={testId}>
<Wrappertestid={testid}>
{subscribed ? (
<Main>
<NotifyOnIcon src={`${ICON}/article/notify-on.svg`} />
Expand DownExpand Up@@ -68,12 +68,12 @@ const NotifyButton = ({ testId, subscribed }) => {
}

NotifyButton.propTypes = {
testId: T.string,
testid: T.string,
subscribed: T.bool,
}

NotifyButton.defaultProps = {
testId: 'notify-button',
testid: 'notify-button',
subscribed: false,
}

Expand Down
2 changes: 1 addition & 1 deletionsrc/components/Buttons/styles/notify_button/index.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,7 +4,7 @@ import Img from '@/Img'
import { css, theme } from '@/utils'

export const Wrapper = styled.div.attrs((props) => ({
'data-test-id': props.testId,
'data-test-id': props.testid,
}))`
${css.flexColumn()};
`
Expand Down
2 changes: 1 addition & 1 deletionsrc/components/Charger/index.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,7 +19,7 @@ const log = buildLog('c:Charger:index')
// bubbles effect: https://codepen.io/Johnm__/pen/qZqgGJ
const Charger = () => {
return (
<WrappertestId="charger">
<Wrappertestid="charger">
<Battery>
<Liquid />
<MoneySign src={`${ICON_CMD}/battery_heart.svg`} />
Expand Down
2 changes: 1 addition & 1 deletionsrc/components/Charger/styles/index.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -106,7 +106,7 @@ const liquid2Rule = styledCss`
`

export const Wrapper = styled.div.attrs((props) => ({
'data-test-id': props.testId,
'data-test-id': props.testid,
}))`
text-align: center;
position: relative;
Expand Down
2 changes: 1 addition & 1 deletionsrc/components/CollapseMenu/Group.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -81,7 +81,7 @@ const Group = ({
key={item.id}
item={item}
active={activeItem.id === item.id}
activeId={activeItem.id}
activeid={activeItem.id}
onSelect={onSelect}
/>
))}
Expand Down
2 changes: 1 addition & 1 deletionsrc/components/CollapseMenu/Item.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ import React from 'react'

import { Wrapper, Title } from './styles/item'

// const Item = ({ item, active,activeId, onSelect }) => {
// const Item = ({ item, active,activeid, onSelect }) => {
const Item = ({ item, active, onSelect }) => {
return (
<Wrapper active={active}>
Expand Down
8 changes: 4 additions & 4 deletionssrc/components/CollapseMenu/index.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,7 +76,7 @@ const defaultItems = [
]

const CollapseMenu = ({
testId,
testid,
items,
activeItem,
onSelect,
Expand All@@ -87,7 +87,7 @@ const CollapseMenu = ({
const groupsKeys = keys(groupedItems)

return (
<WrappertestId={testId}>
<Wrappertestid={testid}>
{groupsKeys.map((groupKey) => (
<Group
key={groupKey}
Expand All@@ -105,7 +105,7 @@ const CollapseMenu = ({
}

CollapseMenu.propTypes = {
testId: T.string,
testid: T.string,
items: T.arrayOf(
T.shape({
id: T.number,
Expand All@@ -124,7 +124,7 @@ CollapseMenu.propTypes = {
}

CollapseMenu.defaultProps = {
testId: 'collapse-menu',
testid: 'collapse-menu',
items: defaultItems,
activeItem: defaultActiveItem,
// default display count in each group, the remaining part will be folded
Expand Down
2 changes: 1 addition & 1 deletionsrc/components/CrashErrorHint/index.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -60,7 +60,7 @@ const CrashErrorHint = ({ onReport }) => {
}, [executeIndex])

return (
<WrappertestId="crashErrorHint" t={themeName}>
<Wrappertestid="crashErrorHint" t={themeName}>
<div />
<div>
<Header index={executeIndex} themeName={themeName} />
Expand Down
2 changes: 1 addition & 1 deletionsrc/components/CrashErrorHint/styles/index.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@ import styled from 'styled-components'
import { css, theme, themeSkins } from '@/utils'

export const Wrapper = styled.div.attrs((props) => ({
'data-test-id': props.testId,
'data-test-id': props.testid,
}))`
${css.flexColumn('align-center', 'justify-between')};
height: 100vh;
Expand Down
8 changes: 4 additions & 4 deletionssrc/components/DigestSentence/index.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -16,7 +16,7 @@ import { Wrapper, PreviewWrapper, PreviewText, PreviewIcon } from './styles'
const log = buildLog('c:DigestSentence:index')

const DigestSentence = ({
testId,
testid,
children,
onPreview,
top,
Expand All@@ -26,7 +26,7 @@ const DigestSentence = ({
}) => {
return (
<Wrapper
testId={testId}
testid={testid}
onClick={onPreview}
top={top}
bottom={bottom}
Expand All@@ -43,7 +43,7 @@ const DigestSentence = ({
}

DigestSentence.propTypes = {
testId: T.string,
testid: T.string,
children: T.oneOfType([T.string, T.node]),
onPreview: T.func,
top: T.number,
Expand All@@ -53,7 +53,7 @@ DigestSentence.propTypes = {
}

DigestSentence.defaultProps = {
testId: 'digest-sentence',
testid: 'digest-sentence',
children: '可能是最性感的开发者社区,来为你心爱的作品建立...',
onPreview: log,
top: 0,
Expand Down
2 changes: 1 addition & 1 deletionsrc/components/DigestSentence/styles/index.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,7 +4,7 @@ import Img from '@/Img'
import { css, theme } from '@/utils'

export const Wrapper = styled.div.attrs((props) => ({
'data-test-id': props.testId,
'data-test-id': props.testid,
}))`
color: ${theme('thread.articleDigest')};
font-size: 13px;
Expand Down
8 changes: 4 additions & 4 deletionssrc/components/DivideText/index.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -14,9 +14,9 @@ import { Wrapper, Content, LeftLine, RightLine } from './styles'
/* eslint-disable-next-line */
const log = buildLog('c:DivideText:index')

const DivideText = ({testId, children }) => {
const DivideText = ({testid, children }) => {
return (
<WrappertestId={testId}>
<Wrappertestid={testid}>
<LeftLine />
<Content>{children}</Content>
<RightLine />
Expand All@@ -25,12 +25,12 @@ const DivideText = ({ testId, children }) => {
}

DivideText.propTypes = {
testId: T.string,
testid: T.string,
children: T.oneOfType([T.string, T.node]).isRequired,
}

DivideText.defaultProps = {
testId: 'divide-text',
testid: 'divide-text',
}

export default React.memo(DivideText)
2 changes: 1 addition & 1 deletionsrc/components/DivideText/styles/index.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,7 +4,7 @@ import styled from 'styled-components'
import { css } from '@/utils'

export const Wrapper = styled.div.attrs((props) => ({
'data-test-id': props.testId,
'data-test-id': props.testid,
}))`
${css.flex('align-center')};
width: 100%;
Expand Down
4 changes: 2 additions & 2 deletionssrc/components/EmailSubscriber/DefaultLayout/index.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,11 +10,11 @@ import { Wrapper, InnerWrapper } from '../styles/default_layout/index'
/* eslint-disable-next-line */
const log = buildLog('c:DefaultLayout:index')

const DefaultLayout = ({testId, activeByDefault, title, desc }) => {
const DefaultLayout = ({testid, activeByDefault, title, desc }) => {
const [active, setActive] = useState(activeByDefault)

return (
<WrappertestId={testId} active={active}>
<Wrappertestid={testid} active={active}>
<InnerWrapper>
{!active ? (
<InActiveView onOpen={() => setActive(true)} />
Expand Down
8 changes: 4 additions & 4 deletionssrc/components/EmailSubscriber/index.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,15 +13,15 @@ import SimpleLayout from './SimpleLayout'
import { Wrapper } from './styles'

const EmailSubscriber = ({
testId,
testid,
title,
desc,
type,
placeholder,
activeByDefault,
}) => {
return (
<WrappertestId={testId}>
<Wrappertestid={testid}>
{type === 'default' ? (
<DefaultLayout
activeByDefault={activeByDefault}
Expand All@@ -36,7 +36,7 @@ const EmailSubscriber = ({
}

EmailSubscriber.propTypes = {
testId: T.string,
testid: T.string,
title: T.string,
desc: T.string,
placeholder: T.string,
Expand All@@ -48,7 +48,7 @@ EmailSubscriber.propTypes = {
}

EmailSubscriber.defaultProps = {
testId: 'emailSubscriber',
testid: 'emailSubscriber',
title: '邮件订阅',
desc: '可随时取消',
placeholder: '邮件订阅',
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,7 +3,7 @@ import styled from 'styled-components'
import { css } from '@/utils'

export const Wrapper = styled.div.attrs((props) => ({
'data-test-id': props.testId,
'data-test-id': props.testid,
}))`
${css.flexColumn('justify-center')};
position: relative;
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp