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

Update lint and format #50

Merged
merged 1 commit into from
Jul 25, 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
7 changes: 4 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Node CI
on:
push:
tags:
- "*"
- '*'
branches:
- main
pull_request:
Expand All @@ -24,11 +24,12 @@ jobs:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: ${{ matrix.node-version }}
- name: node check
run: |
npm ci
npm run lint
npm run format
npm run build
npm test
env:
Expand All @@ -52,7 +53,7 @@ jobs:
exit 1
deploy:
if: startsWith(github.event.ref, 'refs/tags/')
needs: ["status-checks"]
needs: ['status-checks']
runs-on: ubuntu-latest
continue-on-error: true
steps:
Expand Down
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
npm run lint
npm run format
8 changes: 0 additions & 8 deletions .npmignore

This file was deleted.

5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "all",
"printWidth": 100
}
5 changes: 0 additions & 5 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
{
"plugins": ["stylelint-scss"],
"customSyntax": "postcss-scss",
"extends": ["stylelint-config-standard-scss", "stylelint-config-concentric-order"],
"rules": {
"max-empty-lines": 1,
"max-nesting-depth": 3,
"string-quotes": "single",
"selector-class-pattern": "^-?([a-z][a-z0-9]*)(-[a-z0-9]+)*$",
"function-parentheses-newline-inside": "always-multi-line",
"selector-list-comma-newline-after": "always-multi-line",
"no-descending-specificity": null,
"selector-no-qualifying-type": [
true,
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

This is the official Tikui documentation module.


## Create a documentation module

If you want to create your own module, please name it `tikuidoc-$MODULE_NAME` where `MODULE_NAME` is the name of your module.
Expand Down
11 changes: 6 additions & 5 deletions build.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import fs from 'fs';
import path from 'path';


const DIST_LIB = path.resolve(__dirname, 'src', 'documentation', 'lib');
const FONT = '@fontsource/montserrat';
const MODULE_FONT = path.dirname(require.resolve(`${FONT}/package.json`));
const DIST_LIB_FONT = path.resolve(DIST_LIB, FONT);


const fontCopy = (file: string) => fs.cpSync(path.resolve(MODULE_FONT, file), path.resolve(DIST_LIB_FONT, file), {recursive: true});
const fontCopy = (file: string) =>
fs.cpSync(path.resolve(MODULE_FONT, file), path.resolve(DIST_LIB_FONT, file), {
recursive: true,
});
const fontCopyFiles = (...files: string[]) => files.forEach(fontCopy);

console.log(`Reset dist lib folder at ${DIST_LIB}`);

fs.rmSync(DIST_LIB, {recursive: true, force: true});
fs.mkdirSync(DIST_LIB, {recursive: true});
fs.rmSync(DIST_LIB, { recursive: true, force: true });
fs.mkdirSync(DIST_LIB, { recursive: true });

console.log(`Move font files from ${MODULE_FONT} to ${DIST_LIB_FONT}`);

Expand Down
21 changes: 4 additions & 17 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,11 @@
module.exports = {
moduleFileExtensions: [
'js',
'json',
'jsx',
'ts',
'tsx',
'node'
],
moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'node'],
transform: {
'^.+\\.tsx?$': 'ts-jest'
'^.+\\.tsx?$': 'ts-jest',
},
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1'
'^@/(.*)$': '<rootDir>/src/$1',
},
coverageReporters: [
'html',
'json-summary',
'text-summary',
"lcov",
"clover",
],
coverageReporters: ['html', 'json-summary', 'text-summary', 'lcov', 'clover'],
testEnvironment: 'node',
};
Loading