Skip to content

Commit

Permalink
build: bump node package versions (#1429)
Browse files Browse the repository at this point in the history
* build: bump node package versions

* ci: remove node version 16

* wip: fix lint errors

* wip: fix lint errors

* ci: use specific node version
  • Loading branch information
iamogbz authored Nov 30, 2024
1 parent 3d5041b commit c2ed4f1
Show file tree
Hide file tree
Showing 10 changed files with 11,317 additions and 9,128 deletions.
8 changes: 0 additions & 8 deletions .eslintignore

This file was deleted.

92 changes: 0 additions & 92 deletions .eslintrc.json

This file was deleted.

18 changes: 7 additions & 11 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,15 @@ jobs:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Setup
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/action-setup@v2.2.1
node-version-file: .nvmrc
- uses: pnpm/action-setup@v4.0.0
with:
version: 7
version: 9
run_install: |
args: [--no-frozen-lockfile]
- name: Typecheck
Expand Down Expand Up @@ -54,13 +50,13 @@ jobs:
cd ../
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: matrix.node-version == '18.x' && github.ref == 'refs/heads/main' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
if: github.ref == 'refs/heads/main' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
with:
github_token: ${{ secrets.GH_TOKEN }}
publish_dir: ./demo/build
publish_branch: demo
- name: Release
if: matrix.node-version == '18.x' && github.ref == 'refs/heads/main' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
if: github.ref == 'refs/heads/main' && github.actor != 'dependabot[bot]' && github.actor != 'dependabot-preview[bot]'
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.16.0
20.11.1
7 changes: 3 additions & 4 deletions config/mocks/DOMRect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ export default class DOMRect {
right = 0;
top = 0;
constructor(
// eslint-disable-next-line no-unused-vars
public x = 0,
// eslint-disable-next-line no-unused-vars

public y = 0,
// eslint-disable-next-line no-unused-vars

public width = 0,
// eslint-disable-next-line no-unused-vars

public height = 0,
) {
this.left = x;
Expand Down
127 changes: 127 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
import path from "node:path";
import { fileURLToPath } from "node:url";

import { fixupConfigRules } from "@eslint/compat";
import { FlatCompat } from "@eslint/eslintrc";
import js from "@eslint/js";
import tsParser from "@typescript-eslint/parser";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import globals from "globals";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default [
{
ignores: [
"**/.circleci/",
"**/artifacts/",
"**/internals/",
"**/server/",
"**/docs/",
"**/node_modules/",
"**/lib/",
"**/built/",
],
},
...fixupConfigRules(
compat.extends(
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
),
),
{
plugins: {
"simple-import-sort": simpleImportSort,
},

languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.jest,
browser: false,
},

parser: tsParser,
ecmaVersion: 6,
sourceType: "module",

parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},

settings: {
react: {
version: "detect",
},

"import/resolver": {
node: {
paths: ["src"],
},
},
},

rules: {
"class-methods-use-this": "off",
"no-console": "warn",

"no-param-reassign": [
"error",
{
props: false,
},
],

"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
},
],

"no-trailing-spaces": "error",
"no-use-before-define": "off",

"@typescript-eslint/no-use-before-define": [
"error",
{
functions: false,
},
],

"object-curly-newline": [
"error",
{
multiline: true,
consistent: true,
},
],

"object-property-newline": [
"error",
{
allowAllPropertiesOnSameLine: true,
},
],

"react/jsx-first-prop-new-line": ["error", "multiline"],
"react/jsx-indent": ["error", 2],
"react/jsx-indent-props": ["error", 2],
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"prettier/prettier": "error",
},
},
];
Loading

0 comments on commit c2ed4f1

Please sign in to comment.