Skip to content

Commit b91f065

Browse files
chore: Update ESLint configuration, migrate to Vitest, and adjust package structure for improved module support
1 parent d961bb4 commit b91f065

14 files changed

Lines changed: 4382 additions & 6407 deletions

.eslintrc.js

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
11
module.exports = {
2+
root: true,
23
parser: '@typescript-eslint/parser',
3-
extends: ['plugin:@typescript-eslint/recommended', 'prettier', 'plugin:prettier/recommended'],
4-
plugins: ['@typescript-eslint', 'prettier'],
5-
rules: {
6-
'prettier/prettier': [
7-
'error',
8-
{
9-
endOfLine: 'auto',
10-
},
11-
],
4+
plugins: ['@typescript-eslint'],
5+
extends: [
6+
'eslint:recommended',
7+
'plugin:@typescript-eslint/recommended',
8+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
9+
'prettier',
10+
],
11+
parserOptions: {
12+
ecmaVersion: 2020,
13+
sourceType: 'module',
14+
project: './tsconfig.json',
1215
},
1316
env: {
1417
node: true,
15-
jest: true,
18+
es6: true,
19+
},
20+
rules: {
21+
'@typescript-eslint/explicit-function-return-type': 'error',
22+
'@typescript-eslint/no-explicit-any': 'error',
23+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
24+
'no-console': ['warn', { allow: ['warn', 'error'] }],
1625
},
1726
};

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,14 @@ Can be used in Node.js and the browser.
5050

5151
## 🚀 Getting Started
5252

53-
Arabic-Services was designed to work in both the browser and NodeJS applications.
53+
Arabic-Services works in both browser and NodeJS environments.
5454

5555
### Browser
5656

57-
We provide both ESM and UMD bundles for use in the browser.
58-
You can find it with the latest release files.
57+
We provide both ESM and IIFE bundles for use in the browser. You can find them in the dist folder.
5958

6059
```html
61-
<script src="arabic-services.umd.js"></script>
60+
<script src="dist/index.global.js"></script>
6261
<script>
6362
console.log(ArabicServices.removeTashkeel('الخَيْلُ وَاللّيْلُ وَالبَيْداءُ تَعرِفُني'));
6463
// Output: 'الخيل والليل والبيداء تعرفني'
@@ -75,15 +74,15 @@ npm install arabic-services
7574

7675
**CommonJS:**
7776

78-
```javascript
77+
```js
7978
const { ArabicServices } = require('arabic-services');
8079
console.log(ArabicServices.removeTashkeel('الخَيْلُ وَاللّيْلُ وَالبَيْداءُ تَعرِفُني'));
8180
// Output: 'الخيل والليل والبيداء تعرفني'
8281
```
8382

8483
**ES Module:**
8584

86-
```javascript
85+
```js
8786
import { ArabicServices } from 'arabic-services';
8887
console.log(ArabicServices.removeTashkeel('الخَيْلُ وَاللّيْلُ وَالبَيْداءُ تَعرِفُني'));
8988
// Output: 'الخيل والليل والبيداء تعرفني'

README_AR.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,19 @@
4545

4646
<h3 align=center><a href="https://github.com/Seen-Arabic/Arabic-Services-JavaScript/wiki/Features%E2%80%90Documentation%E2%80%90AR">➡️ شاهد استخدام كل ميزة من المكتبة وطريقة استخدامها في الكود ⬅️</a></h3>
4747

48-
## 🚀 التثبيت
48+
## 🚀 البدء السريع
4949

50-
تم تصميم خدمات العربية لتعمل في كل من المتصفح وتطبيقات NodeJS.
50+
تعمل Arabic-Services في كل من المتصفح وبيئة NodeJS.
5151

5252
### المتصفح
5353

54-
نوفر حزم ESM و UMD للاستخدام في المتصفح. يمكن العثور عليها مع ملفات الإصدار الأخير.
54+
نوفر حزم ESM و IIFE للاستخدام في المتصفح. يمكن العثور عليها في مجلد dist.
5555

5656
```html
57-
<script src="arabic-services.umd.js"></script>
57+
<script src="dist/index.global.js"></script>
5858
<script>
5959
console.log(ArabicServices.removeTashkeel('الخَيْلُ وَاللّيْلُ وَالبَيْداءُ تَعرِفُني'));
60-
// Output: 'الخيل والليل والبيداء تعرفني'
60+
// الناتج: 'الخيل والليل والبيداء تعرفني'
6161
</script>
6262
```
6363

@@ -71,18 +71,18 @@ npm install arabic-services
7171

7272
**CommonJS:**
7373

74-
```javascript
74+
```js
7575
const { ArabicServices } = require('arabic-services');
7676
console.log(ArabicServices.removeTashkeel('الخَيْلُ وَاللّيْلُ وَالبَيْداءُ تَعرِفُني'));
77-
// Output: 'الخيل والليل والبيداء تعرفني'
77+
// الناتج: 'الخيل والليل والبيداء تعرفني'
7878
```
7979

8080
**ES Module:**
8181

82-
```javascript
82+
```js
8383
import { ArabicServices } from 'arabic-services';
8484
console.log(ArabicServices.removeTashkeel('الخَيْلُ وَاللّيْلُ وَالبَيْداءُ تَعرِفُني'));
85-
// Output: 'الخيل والليل والبيداء تعرفني'
85+
// الناتج: 'الخيل والليل والبيداء تعرفني'
8686
```
8787

8888
## 💡 المساهمة

example.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<title>Document</title>
6+
<title>Arabic Services Example</title>
77
<link
88
rel="icon"
99
type="image/svg"
1010
href="https://seen-arabic.github.io/Arabic-Services/assets/images/logo-circle.svg"
1111
/>
1212
</head>
1313
<body>
14-
<!-- run npm run bundle to get arabic-services.umd.js file -->
15-
<script src="./dist/umd/arabic-services.umd.js"></script>
14+
<!-- run npm run build to get the output files -->
15+
<script src="./dist/index.global.js"></script>
1616
<script>
1717
console.log('ArabicServices:', ArabicServices);
1818
console.log('-------- Functions --------');

jest.config.cjs

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)