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

Feat/tsconfig #8

Merged
merged 4 commits into from
Dec 4, 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
2 changes: 1 addition & 1 deletion .yarn/sdks/prettier/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prettier",
"version": "3.3.3-sdk",
"version": "3.4.2-sdk",
"main": "./index.cjs",
"type": "commonjs",
"bin": "./bin/prettier.cjs"
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"description": "Necessary library for all ECMAScript (JavaScript/TypeScript) projects.",
"repository": "https://github.com/the-nexim/nanolib",
"author": "S. Amir Mohammad Najafi <njfamirm@gmail.com> (www.njfamirm.ir)",
"contributors": [
"Arash Ghardashpoor <arash.qardashpoor@gmail.com> (https://www.agpagp.ir)"
],
"license": "AGPL-3.0-only",
"type": "module",
"private": true,
Expand Down Expand Up @@ -47,6 +50,7 @@
"@lerna-lite/publish": "^3.10.1",
"@lerna-lite/run": "^3.10.1",
"@lerna-lite/version": "^3.10.1",
"@nexim/tsconfig-base": "workspace:^",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"ava": "^6.2.0",
Expand All @@ -56,10 +60,11 @@
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-require-extensions": "^0.1.3",
"prettier": "^3.4.2",
"prettier-plugin-packagejson": "^2.5.6",
"prettier-plugin-tailwindcss": "^0.6.9",
"typescript": "^5.6.3"
},
"packageManager": "yarn@4.5.1",
"packageManager": "yarn@4.5.3",
"dependenciesMeta": {
"prettier-plugin-tailwindcss@0.6.9": {
"unplugged": true
Expand Down
2 changes: 1 addition & 1 deletion packages/element/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
"devDependencies": {
"@alwatr/nano-build": "^5.0.0",
"@alwatr/prettier-config": "^5.0.0",
"@alwatr/tsconfig-base": "^5.0.0",
"@alwatr/type-helper": "^5.0.0",
"@nexim/tsconfig-base": "workspace:^",
"ava": "^6.2.0",
"typescript": "^5.6.3"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/element/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@alwatr/tsconfig-base/tsconfig.json",
"extends": "@nexim/tsconfig-base",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
Expand Down
661 changes: 661 additions & 0 deletions packages/eslint-config/LICENSE

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions packages/eslint-config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Nexim's ESLint Configurations

Alwatr ECMAScript Style Guide as a ESLint [shareable configurations](http://eslint.org/docs/developer-guide/shareable-configs.html).

## Installation

```bash
yarn add -D @nexim/eslint-config \
eslint \
@typescript-eslint/parser \
@typescript-eslint/eslint-plugin \
eslint-plugin-import \
eslint-import-resolver-typescript
```

## Usage

Create a `.eslintrc.json` file in the root of your project:

```json
{
"extends": "@nexim/eslint-config",
"rules": {
// Additional, per-project rules...
}
}
```
94 changes: 94 additions & 0 deletions packages/eslint-config/eslint-config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/**
* @type {import('eslint').Linter.Config}
*/
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/strict',
'plugin:@typescript-eslint/stylistic',
// "plugin:@typescript-eslint/strict-type-checked",
// "plugin:@typescript-eslint/stylistic-type-checked",
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:require-extensions/recommended',
],
env: {
'shared-node-browser': true,
es2023: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
project: true,
ecmaVersion: 2023,
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'import', 'require-extensions'],
settings: {
'import/resolver': {
typescript: {
alwaysTryTypes: true,
ecmaVersion: 2023,
project: ['**/tsconfig.json'],
projectFolderIgnoreList: ['**/node_modules/**'],
},
node: true,
},
'import/extensions': ['.js', '.mjs', '.ts', '.d.ts'],
},
rules: {
'max-len': ['error', {code: 140}],
'no-eval': ['error', {allowIndirect: true}],
'no-floating-decimal': 'error',
'space-infix-ops': 'error',
'new-cap': ['error', {capIsNewExceptionPattern: 'Mixin$'}],
'brace-style': ['error', 'stroustrup', {allowSingleLine: true}],
indent: 'off',
'@typescript-eslint/indent': [
'error',
2,
{
SwitchCase: 1,
VariableDeclarator: 1,
outerIIFEBody: 1,
MemberExpression: 1,
FunctionDeclaration: {parameters: 1, body: 1},
FunctionExpression: {parameters: 1, body: 1},
CallExpression: {arguments: 1},
ArrayExpression: 1,
ObjectExpression: 1,
ImportDeclaration: 1,
flatTernaryExpressions: false,
ignoreComments: false,
ignoredNodes: [
'TemplateLiteral *',
'TSTypeParameterInstantiation',
'FunctionExpression > .params[decorators.length > 0]',
'FunctionExpression > .params > :matches(Decorator, :not(:first-child))',
'ClassBody.body > PropertyDefinition[decorators.length > 0] > .key',
],
},
],
'operator-linebreak': ['error', 'after', {overrides: {'?': 'before', ':': 'before'}}],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', ['parent', 'sibling', 'index'], 'object', 'unknown', 'type'],
'newlines-between': 'always',
warnOnUnassignedImports: true,
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'@typescript-eslint/prefer-string-starts-ends-with': 'off',
'@typescript-eslint/no-dynamic-delete': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'no-throw-literal': 'off',
'no-unused-labels': 'off',
'require-jsdoc': 'off',
'valid-jsdoc': 'off',
"require-await": "error"
},
};
67 changes: 67 additions & 0 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"name": "@nexim/eslint-config",
"version": "0.0.0",
"description": "Nexim ECMAScript Style Guide as a ESLint shareable configurations.",
"keywords": [
"eslint",
"eslint-config",
"lint",
"linter",
"style-guide",
"cross-platform",
"ECMAScript",
"typescript",
"javascript",
"node",
"nodejs",
"browser",
"esm",
"module",
"utility",
"util",
"utils",
"nanolib",
"alwatr"
],
"homepage": "https://github.com/the-nexim/nanolib/",
"bugs": {
"url": "https://github.com/the-nexim/nanolib/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/the-nexim/nanolib",
"directory": "packages/eslint-config"
},
"license": "AGPL-3.0-only",
"author": "S. Amir Mohammad Najafi <njfamirm@gmail.com> (www.njfamirm.ir)",
"contributors": [
"Arash Ghardashpoor <arash.qardashpoor@gmail.com> (https://www.agpagp.ir)"
],
"type": "commonjs",
"main": "./eslint-config.cjs",
"files": [
"**/*.{js,mjs,cjs,map,d.ts,html,md,LEGAL.txt}",
"LICENSE",
"!demo/**/*"
],
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"eslint": "^8.57.1",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-require-extensions": "^0.1.3",
"typescript": "^5.6.3"
},
"peerDependencies": {
"@typescript-eslint/eslint-plugin": ">7.0.0 <8.0.0",
"@typescript-eslint/parser": ">7.0.0 <8.0.0",
"eslint": ">8.0.0 <9.0.0",
"eslint-import-resolver-typescript": ">3.0.0",
"eslint-plugin-import": ">2.0.0",
"eslint-plugin-require-extensions": ">0.1.0"
},
"publishConfig": {
"access": "public"
}
}
Loading
Loading