Skip to content

Commit

Permalink
refactor: small changes (#127)
Browse files Browse the repository at this point in the history
Co-authored-by: Almanov Nikita <131481562+nikkeyl@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and nikkeyl authored Nov 11, 2024
1 parent d393753 commit 7a17b97
Show file tree
Hide file tree
Showing 13 changed files with 1,013 additions and 1,024 deletions.
1 change: 1 addition & 0 deletions .ecrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"exclude": [
"config.yml",
"CHANGELOG.md",
"pnpm-lock.yaml",
"README.md"
Expand Down
1 change: 0 additions & 1 deletion .github/FUNDING.yaml

This file was deleted.

10 changes: 10 additions & 0 deletions .github/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
newIssueWelcomeComment: >
Thanks for opening your first **Issue** here!
Be sure to follow the **Issue template**!
newPRWelcomeComment: >
Thanks for opening this **Pull Request**!
Please check out our [Contributing Guidelines](https://github.com/archoleat/.github/blob/main/CONTRIBUTING.md).
firstPRMergeComment: >
Congrats on merging your first **Pull Request**!
49 changes: 0 additions & 49 deletions .github/workflows/codeql.yaml

This file was deleted.

4 changes: 3 additions & 1 deletion .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
pre-commit:
name: Pre-commit
name: Pre Commit

if: ${{ github.actor != 'dependabot[bot]' }}

Expand All @@ -20,6 +20,8 @@ jobs:

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.13

- name: Lint
uses: pre-commit/action@v3.0.1
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ jobs:
run: pnpm i

- name: Build
run: pnpm build
run: pnpm rollup -c rollup.config.ts --configPlugin typescript

- name: Pretty
- name: Prettify
run: pnpm prettier 'index.d.ts' --write

- name: Create Release
Expand Down
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
![NPM Downloads](https://img.shields.io/npm/dm/%40archoleat%2Fvalidate-font-file-name)
![ESM](https://img.shields.io/badge/ESM-fe0)
![Provenance](https://img.shields.io/badge/Provenance-fo0)
![CodeQL](https://img.shields.io/github/actions/workflow/status/archoleat/validate-font-file-name/codeql.yaml?label=CodeQL)
![Specs](https://img.shields.io/github/actions/workflow/status/archoleat/validate-font-file-name/spec.yaml?label=Specs)
![Commitlint](https://img.shields.io/github/actions/workflow/status/archoleat/validate-font-file-name/commitlint.yaml?label=Commitlint)
![Editorconfig](https://img.shields.io/github/actions/workflow/status/archoleat/validate-font-file-name/editorconfig.yaml?label=Editorconfig)
Expand All @@ -27,25 +26,27 @@ bun i -D @archoleat/validate-font-file-name

## Usage

```js
import { validateFontFileName } from '@archoleat/validate-font-file-name';

await validateFontFileName({
file: string,
regex?: string | RegExp,
});
```

### Naming Convention

The **font family** and **font weight** must be in **Pascal Case**
and separated by a **hyphen**.

Extensions that are allowed: `otf`, `ttf`, `woff`, `woff2`.
Postfixes that are allowed: `Italic`, `Variable`.

> Example: `OpenSans-SemiBold.woff2`.
Extensions that are allowed: `woff2`, `woff`, `otf`, `ttf`.

It's not necessary to specify the `regex` parameter.

```js
import { validateFontFileName } from '@archoleat/validate-font-file-name';

await validateFontFileName({
file: 'path/to/file',
regex: /regex/ | new RegExp() | '',
});
```
> Examples: `FontFamily-Bold.woff2`,
> `FontFamily-SemiBoldItalic.woff`, `FontFamily-MediumVariable.otf`,
> `FontFamily-RegularItalicVariable.ttf`.
## Contributing

Expand Down
36 changes: 12 additions & 24 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,23 @@
import { defineFlatConfig } from 'eslint-define-config';
import { extend } from '@archoleat/eslint-flat-compatibility';

import globals from 'globals';

import importSortPlugin from 'eslint-plugin-simple-import-sort';
import parser from '@typescript-eslint/parser';
import prettierConfig from 'eslint-config-prettier';
import unicornPlugin from 'eslint-plugin-unicorn';

import parser from '@typescript-eslint/parser';

export default defineFlatConfig([
...extend(
'airbnb-base',
'airbnb-typescript/base',
'plugin:import/recommended',
'plugin:import/typescript',
),
unicornPlugin.configs['flat/recommended'],
...extend('airbnb-base', 'airbnb-typescript/base'),
{
files: ['src/**/*.ts'],
languageOptions: {
parser,
ecmaVersion: 'latest',
globals: {
...globals.node,
...globals.es2015,
},
parserOptions: {
ecmaVersion: 'latest',
project: 'tsconfig.json',
},
sourceType: 'module',
Expand All @@ -36,26 +29,21 @@ export default defineFlatConfig([
},
},
},
plugins: {
'simple-import-sort': importSortPlugin,
unicorn: unicornPlugin,
},
rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'import/exports-last': 'error',
'import/extensions': ['error', { ts: 'always' }],
'import/group-exports': 'error',
'import/no-commonjs': 'error',
'import/no-default-export': 'error',
'import/no-default-export': 'off',
'import/no-namespace': 'error',
'import/no-unassigned-import': 'error',
'import/prefer-default-export': 'off',
'unicorn/import-style': [
'error',
{
styles: {
'node:path': {
default: false,
named: true,
},
},
},
],
'unicorn/no-unused-properties': 'error',
'unicorn/string-content': 'error',
},
Expand Down
52 changes: 25 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@archoleat/validate-font-file-name",
"description": "Checking font file names for standardization",
"description": "Validate font file names",
"version": "1.2.0",
"license": "MIT",
"author": {
Expand All @@ -19,11 +19,9 @@
"keywords": [
"archoleat-font-file-name",
"archoleat",
"font-file-name-standard",
"font-file-name",
"naming",
"plugin",
"standard",
"validate-font-file-name",
"validate-name",
"validate",
Expand All @@ -48,54 +46,54 @@
"index.js"
],
"scripts": {
"init": "pnpm i && husky",
"build": "rollup -c rollup.config.ts --configPlugin typescript"
"init": "pnpm i && husky"
},
"dependencies": {
"@archoleat/notifier": "^1.0.2",
"@archoleat/reglib": "^1.1.0"
"@archoleat/notifier": "^1.0.3",
"@archoleat/reglib": "^1.2.0"
},
"devDependencies": {
"@archoleat/commitlint-define-config": "^1.0.11",
"@archoleat/eslint-flat-compatibility": "^1.1.8",
"@archoleat/prettier-define-config": "^1.0.2",
"@archoleat/semantic-release-define-config": "^1.1.16",
"@commitlint/cli": "^19.4.1",
"@commitlint/config-conventional": "^19.4.1",
"@commitlint/types": "^19.0.3",
"@archoleat/commitlint-define-config": "^1.1.0",
"@archoleat/eslint-flat-compatibility": "^1.2.1",
"@archoleat/prettier-define-config": "^1.1.0",
"@archoleat/semantic-release-define-config": "^1.2.0",
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@commitlint/types": "^19.5.0",
"@rollup/plugin-alias": "^5.1.1",
"@rollup/plugin-typescript": "^11.1.6",
"@rollup/plugin-typescript": "^12.1.1",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@types/node": "^22.5.2",
"@types/node": "^22.9.0",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@vitest/coverage-v8": "^2.0.5",
"@vitest/coverage-v8": "^2.1.4",
"conventional-changelog-conventionalcommits": "^8.0.0",
"editorconfig-checker": "^5.1.8",
"eslint": "^8.57.0",
"editorconfig-checker": "^6.0.0",
"eslint": "^8.57.1",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-define-config": "^2.1.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-unicorn": "^55.0.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-unicorn": "^56.0.0",
"git-pull-run": "^1.4.0",
"globals": "^15.9.0",
"husky": "^9.1.5",
"globals": "^15.12.0",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"prettier": "^3.3.3",
"remark": "15.0.1",
"remark-cli": "^12.0.1",
"remark-preset-lint-consistent": "^6.0.0",
"remark-preset-lint-markdown-style-guide": "^6.0.0",
"remark-preset-lint-recommended": "^7.0.0",
"rollup": "^4.21.2",
"rollup": "^4.25.0",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-esbuild": "^6.1.1",
"semantic-release": "^24.1.0",
"typescript": "^5.5.4",
"vitest": "^2.0.5"
"semantic-release": "^24.2.0",
"typescript": "^5.6.3",
"vitest": "^2.1.4"
}
}
Loading

0 comments on commit 7a17b97

Please sign in to comment.