Skip to content

Commit b62c53d

Browse files
perf: setup lint
1 parent efaa457 commit b62c53d

File tree

8 files changed

+27
-36
lines changed

8 files changed

+27
-36
lines changed

.eslintrc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{
22
"root": true,
33
"extends": [
4-
"@react-native",
5-
"prettier"
4+
"@react-native"
65
],
76
"rules": {
8-
"prettier/prettier": "off"
9-
}
7+
"react-native/no-inline-styles": ["off"]
8+
}
109
}

.github/workflows/ci.yml

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,6 @@ jobs:
2020
- name: Lint files
2121
run: yarn lint
2222

23-
- name: Typecheck files
24-
run: yarn typecheck
25-
26-
test:
27-
runs-on: ubuntu-latest
28-
steps:
29-
- name: Checkout
30-
uses: actions/checkout@v3
31-
32-
- name: Setup
33-
uses: ./.github/actions/setup
34-
35-
- name: Run unit tests
36-
run: yarn test --maxWorkers=2 --coverage
37-
3823
build-library:
3924
runs-on: ubuntu-latest
4025
steps:
@@ -44,20 +29,16 @@ jobs:
4429
- name: Setup
4530
uses: ./.github/actions/setup
4631

47-
- name: Build package
48-
run: yarn prepare
49-
50-
- name: Login NPM
51-
run: echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" > ~/.npmrc
52-
5332
- name: Config Git
5433
run: |
5534
git config --global user.email "hmdarkfire.dev@gmail.com"
5635
git config --global user.name "Henrique Marques"
5736
37+
- name: Login NPM
38+
run: echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" > ~/.npmrc
39+
5840
- name: Release
5941
run: yarn release
6042
env:
6143
GITHUB_TOKEN: ${{secrets.GHP_TOKEN}}
62-
6344

.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
"printWidth": 100,
1010
"useTabs": false,
1111
"tabWidth": 2,
12-
"trailingComma": "es5"
12+
"trailingComma": "es5",
13+
"endOfLine": "crlf"
1314
}

example/metro.config.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ const config = {
2020
// So we block them at the root, and alias them to the versions in example's node_modules
2121
resolver: {
2222
blacklistRE: exclusionList(
23-
modules.map(
24-
(m) =>
25-
new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`)
26-
)
23+
modules.map((m) => new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`))
2724
),
2825

2926
extraNodeModules: modules.reduce((acc, name) => {

jest.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
preset: 'react-native',
3+
modulePathIgnorePatterns: ['<rootDir>/example/node_modules'],
4+
setupFiles: ['<rootDir>/jest.setup.js'],
5+
testRegex: '(/__tests__/.*|(\\.|/)(test))\\.[jt]sx?$',
6+
};

jest.setup.js

Whitespace-only changes.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"example": "yarn workspace react-native-linear-gradient-text-example",
3030
"test": "jest",
3131
"typecheck": "tsc --noEmit",
32-
"lint": "eslint \"**/*.{js,ts,tsx}\"",
32+
"lint": "eslint \"**/*.{js,ts,tsx}\" --fix",
3333
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
3434
"prepare": "bob build",
3535
"release": "release-it"

src/components/LinearGradientText.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,22 @@ interface Props {
1414
}
1515

1616
export const LinearGradientText: FC<Props> = (props) => {
17-
const { text, textStyle = {}, textProps={}, colors, start = { x: 0, y: 1 }, end = { x: 1, y: 1 } } = props;
17+
const {
18+
text,
19+
textStyle = {},
20+
textProps = {},
21+
colors,
22+
start = { x: 0, y: 1 },
23+
end = { x: 1, y: 1 },
24+
} = props;
1825

1926
return (
2027
<MaskedView maskElement={<Text style={[styles.maskText, textStyle]}>{text}</Text>}>
2128
<LinearGradient colors={colors} start={start} end={end}>
22-
<Text style={[styles.text, textStyle]} {...textProps}>
29+
<Text style={[styles.text, textStyle]} {...textProps}>
2330
{text}
24-
</Text>
25-
</LinearGradient>
31+
</Text>
32+
</LinearGradient>
2633
</MaskedView>
2734
);
2835
};

0 commit comments

Comments
 (0)