Skip to content

Commit 9621ca1

Browse files
authored
Merge pull request #154 from seznam/dev-ops
Turbo, eslint update, types exports, new tsconfig...
2 parents c32f7da + 06cdf25 commit 9621ca1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1939
-2608
lines changed

.changeset/strong-falcons-wait.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
"@ima/cli-plugin-less-constants": patch
3+
"@ima/plugin-analytic-fb-pixel": patch
4+
"@ima/cli-plugin-scramble-css": patch
5+
"@ima/plugin-analytic-google": patch
6+
"@ima/cli-plugin-legacy-css": patch
7+
"@ima/plugin-local-storage": patch
8+
"@ima/plugin-script-loader": patch
9+
"@ima/plugin-style-loader": patch
10+
"@ima/cli-plugin-analyze": patch
11+
"@ima/plugin-http-client": patch
12+
"@ima/plugin-useragent": patch
13+
"@ima/plugin-analytic": patch
14+
"@ima/plugin-logger": patch
15+
"@ima/plugin-atoms": patch
16+
---
17+
18+
Turbo, eslint update, types exports, new tsconfig

.eslintrc.js

+25-7
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ module.exports = {
88
],
99
extends: [
1010
'eslint:recommended',
11-
'plugin:jsdoc/recommended',
1211
'plugin:react/recommended',
1312
'plugin:react/jsx-runtime',
1413
'plugin:jest/recommended',
1514
'plugin:jest/style',
1615
'plugin:import/recommended',
1716
'plugin:prettier/recommended',
17+
'plugin:jsdoc/recommended-typescript-flavor',
1818
],
1919
rules: {
2020
// JSDoc plugin
@@ -144,11 +144,33 @@ module.exports = {
144144
{
145145
files: ['**/*.{ts,tsx}'],
146146
parserOptions: {
147-
tsconfigRootDir: __dirname,
148-
project: './tsconfig.json',
147+
project: [
148+
'./tsconfig.json',
149+
'./apps/*/tsconfig.json',
150+
'./packages/*/tsconfig.json',
151+
],
149152
},
150153
extends: ['plugin:@typescript-eslint/recommended'],
151154
rules: {
155+
'@typescript-eslint/prefer-nullish-coalescing': 'off',
156+
'@typescript-eslint/prefer-optional-chain': 'error',
157+
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
158+
'default-param-last': 'off',
159+
'@typescript-eslint/default-param-last': 'error',
160+
'@typescript-eslint/method-signature-style': ['error', 'property'],
161+
'dot-notation': 'off',
162+
'@typescript-eslint/no-require-imports': 'error',
163+
'@typescript-eslint/dot-notation': 'error',
164+
'@typescript-eslint/consistent-type-definitions': 'off',
165+
'@typescript-eslint/no-import-type-side-effects': 'error',
166+
'@typescript-eslint/consistent-type-imports': 'error',
167+
'@typescript-eslint/consistent-type-exports': 'error',
168+
'@typescript-eslint/no-non-null-assertion': 'off',
169+
'@typescript-eslint/no-explicit-any': 'warn',
170+
'@typescript-eslint/ban-ts-comment': [
171+
'error',
172+
{ 'ts-expect-error': 'off' },
173+
],
152174
'@typescript-eslint/no-unused-vars': [
153175
'error',
154176
{
@@ -159,10 +181,6 @@ module.exports = {
159181
args: 'none',
160182
},
161183
],
162-
'@typescript-eslint/ban-ts-comment': [
163-
'error',
164-
{ 'ts-expect-error': 'off' },
165-
],
166184
'@typescript-eslint/no-namespace': [
167185
'error',
168186
{ allowDeclarations: true },
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: "Prepare Node.js workspace"
2+
description: "Prepares Node.js workspace with installed dependencies"
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- uses: actions/checkout@v4
8+
- uses: actions/setup-node@v4
9+
with:
10+
node-version-file: '.nvmrc'
11+
registry-url: 'https://registry.npmjs.org'
12+
cache: 'npm'
13+
14+
- name: Install Dependencies
15+
shell: bash
16+
run: npm ci

.github/workflows/ci.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- next
8+
pull_request:
9+
workflow_call:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
ci:
17+
name: CI
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: ./.github/actions/prepare-workspace
22+
23+
- name: Run Lint
24+
run: npm run lint
25+
26+
- name: Run Stylelint
27+
run: npm run stylelint
28+
29+
- name: Run Tests
30+
run: npm run test:all
31+
32+
release:
33+
if: github.ref_name == 'master' || github.ref_name == 'next'
34+
needs: [ci]
35+
name: Release
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
- uses: ./.github/actions/prepare-workspace
40+
41+
- name: Release new versions
42+
env:
43+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
44+
run: npm run release:publish

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
**/coverage/
99
.eslintcache
1010
*.tgz
11+
**/.turbo

.travis.yml

-22
This file was deleted.

__.github/workflows/ci.yml

-34
This file was deleted.

ima-plugin.config.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const {
2+
defaultConfig,
3+
typescriptDeclarationsPlugin,
4+
} = require('@ima/plugin-cli');
5+
6+
/**
7+
* @type import('@ima/plugin-cli').ImaPluginConfig[]
8+
*/
9+
module.exports = [
10+
{
11+
...defaultConfig,
12+
plugins: [
13+
typescriptDeclarationsPlugin({
14+
allowFailure: false,
15+
additionalArgs: ['--skipLibCheck'],
16+
}),
17+
],
18+
},
19+
];

0 commit comments

Comments
 (0)