Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turbo, eslint update, types exports, new tsconfig... #154

Merged
merged 9 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .changeset/strong-falcons-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
"@ima/cli-plugin-less-constants": patch
"@ima/plugin-analytic-fb-pixel": patch
"@ima/cli-plugin-scramble-css": patch
"@ima/plugin-analytic-google": patch
"@ima/cli-plugin-legacy-css": patch
"@ima/plugin-local-storage": patch
"@ima/plugin-script-loader": patch
"@ima/plugin-style-loader": patch
"@ima/cli-plugin-analyze": patch
"@ima/plugin-http-client": patch
"@ima/plugin-useragent": patch
"@ima/plugin-analytic": patch
"@ima/plugin-logger": patch
"@ima/plugin-atoms": patch
---

Turbo, eslint update, types exports, new tsconfig
32 changes: 25 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ module.exports = {
],
extends: [
'eslint:recommended',
'plugin:jsdoc/recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:jest/recommended',
'plugin:jest/style',
'plugin:import/recommended',
'plugin:prettier/recommended',
'plugin:jsdoc/recommended-typescript-flavor',
],
rules: {
// JSDoc plugin
Expand Down Expand Up @@ -144,11 +144,33 @@ module.exports = {
{
files: ['**/*.{ts,tsx}'],
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json',
project: [
'./tsconfig.json',
'./apps/*/tsconfig.json',
'./packages/*/tsconfig.json',
],
},
extends: ['plugin:@typescript-eslint/recommended'],
rules: {
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
'default-param-last': 'off',
'@typescript-eslint/default-param-last': 'error',
'@typescript-eslint/method-signature-style': ['error', 'property'],
'dot-notation': 'off',
'@typescript-eslint/no-require-imports': 'error',
'@typescript-eslint/dot-notation': 'error',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/no-import-type-side-effects': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/consistent-type-exports': 'error',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/ban-ts-comment': [
'error',
{ 'ts-expect-error': 'off' },
],
'@typescript-eslint/no-unused-vars': [
'error',
{
Expand All @@ -159,10 +181,6 @@ module.exports = {
args: 'none',
},
],
'@typescript-eslint/ban-ts-comment': [
'error',
{ 'ts-expect-error': 'off' },
],
'@typescript-eslint/no-namespace': [
'error',
{ allowDeclarations: true },
Expand Down
16 changes: 16 additions & 0 deletions .github/actions/prepare-workspace/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "Prepare Node.js workspace"
description: "Prepares Node.js workspace with installed dependencies"

runs:
using: composite
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'

- name: Install Dependencies
shell: bash
run: npm ci
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI

on:
push:
branches:
- master
- next
pull_request:
workflow_call:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
ci:
name: CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare-workspace

- name: Run Lint
run: npm run lint

- name: Run Stylelint
run: npm run stylelint

- name: Run Tests
run: npm run test:all

release:
if: github.ref_name == 'master' || github.ref_name == 'next'
needs: [ci]
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare-workspace

- name: Release new versions
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm run release:publish
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
**/coverage/
.eslintcache
*.tgz
**/.turbo
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

34 changes: 0 additions & 34 deletions __.github/workflows/ci.yml

This file was deleted.

19 changes: 19 additions & 0 deletions ima-plugin.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const {
defaultConfig,
typescriptDeclarationsPlugin,
} = require('@ima/plugin-cli');

/**
* @type import('@ima/plugin-cli').ImaPluginConfig[]

Check warning on line 7 in ima-plugin.config.js

View workflow job for this annotation

GitHub Actions / CI

Tag @type must have a type
*/
module.exports = [
{
...defaultConfig,
plugins: [
typescriptDeclarationsPlugin({
allowFailure: false,
additionalArgs: ['--skipLibCheck'],
}),
],
},
];
Loading
Loading