Skip to content

Commit

Permalink
chore: eslint v9 and esm only
Browse files Browse the repository at this point in the history
  • Loading branch information
imranbarbhuiya committed Oct 25, 2024
1 parent 1dcc201 commit 1b6c509
Show file tree
Hide file tree
Showing 10 changed files with 2,191 additions and 2,021 deletions.
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

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

This file was deleted.

7 changes: 4 additions & 3 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"organizeImports": {
"enabled": true
},
Expand All @@ -10,12 +10,13 @@
"lineWidth": 120,
"lineEnding": "lf",
"indentWidth": 4,
"indentStyle": "tab"
"indentStyle": "tab",
"ignore": ["package.json"]
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"trailingComma": "all",
"trailingCommas": "all",
"quoteProperties": "asNeeded"
}
},
Expand Down
29 changes: 29 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import common from 'eslint-config-mahir/common';
import node from 'eslint-config-mahir/node';
import typescript from 'eslint-config-mahir/typescript';

/**
* @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigArray}
*/
export default [
...common,
...node,
...typescript,
{
rules: {
'import-x/order': 'off',
},
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: ['eslint.config.js', 'tsup.config.ts', 'vitest.config.ts'],
defaultProject: 'tsconfig.base.json',
},
tsconfigRootDir: import.meta.dirname,
},
},
},
{
ignores: ['.github', '.yarn', 'dist'],
},
];
37 changes: 14 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,34 @@
"name": "@imranbarbhuiya/package-template",
"version": "0.0.1",
"description": "Package description.",
"type": "module",
"main": "dist/index.js",
"module": "dist/index.mjs",
"browser": "dist/index.global.js",
"unpkg": "dist/index.global.js",
"types": "dist/index.d.ts",
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
"import": "./dist/index.mjs"
},
"sideEffects": false,
"license": "MIT",
"author": "@imranbarbhuiya",
"scripts": {
"docs": "typedoc",
"lint": "eslint src tests --fix --cache",
"format": "biome check --apply .",
"lint": "eslint . --fix --cache",
"format": "biome check --write .",
"test": "vitest run",
"test:watch": "vitest",
"update": "yarn upgrade-interactive",
"build": "tsup",
"typecheck": "tsc -p tsconfig.eslint.json",
"typecheck": "tsc -p tsconfig.base.json",
"bump": "cliff-jumper",
"check-update": "cliff-jumper --dry-run",
"prepack": "yarn build && pinst --disable",
"postinstall": "husky install .github/husky",
"postpack": "pinst --enable"
},
"keywords": [
"some keywords"
],
"keywords": ["some keywords"],
"publishConfig": {
"access": "public"
},
Expand All @@ -41,25 +38,21 @@
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@favware/cliff-jumper": "^5.0.0",
"@favware/npm-deprecate": "^1.0.7",
"@types/node": "^20.16.13",
"@favware/npm-deprecate": "^2.0.0",
"@types/node": "^22.8.0",
"@vitest/coverage-v8": "^2.1.3",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.57.1",
"eslint-config-mahir": "^0.0.46",
"eslint": "^9.13.0",
"eslint-config-mahir": "^1.0.3",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"pinst": "^3.0.0",
"tsup": "^8.3.0",
"tsup": "^8.3.4",
"typedoc": "^0.26.10",
"typescript": "^5.6.3",
"vitest": "^2.1.3"
},
"files": [
"dist/**/*.js*",
"dist/**/*.mjs*",
"dist/**/*.d*"
],
"files": ["dist/**"],
"repository": {
"type": "git",
"url": "git+https://github.com/imranbarbhuiya/template.git"
Expand All @@ -69,12 +62,10 @@
},
"homepage": "https://template.js.org/",
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
"extends": ["@commitlint/config-conventional"]
},
"lint-staged": {
"*.{mjs,js,ts}": "eslint --fix --ext mjs,js,ts"
"*.{mjs,js,ts}": "eslint --fix"
},
"config": {
"commitizen": {
Expand Down
12 changes: 8 additions & 4 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"types": ["vitest/globals"],
"target": "esnext",
"module": "commonjs",
"module": "preserve",
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
Expand All @@ -11,10 +12,13 @@
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"moduleResolution": "bundler",
"verbatimModuleSyntax": true,
"skipLibCheck": true,
"lib": ["es2021"],
"declaration": true,
"outDir": "dist"
"emitDeclarationOnly": true,
"noEmit": true
},
"includes": ["src/**/*.ts"]
"include": ["src", "tests", "scripts", "vitest.config.ts", "tsup.config.ts", "eslint.config.js"]
}
10 changes: 0 additions & 10 deletions tsconfig.eslint.json

This file was deleted.

4 changes: 2 additions & 2 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ export default defineConfig({
clean: true,
dts: true,
entry: ['src/index.ts'],
format: ['esm', 'cjs', 'iife'],
format: ['esm', 'iife'],
minify: false,
skipNodeModulesBundle: true,
sourcemap: true,
target: 'esnext',
keepNames: true,
globalName: 'template',
tsconfig: 'src/tsconfig.json',
treeshake: true
treeshake: true,
});
6 changes: 3 additions & 3 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default defineConfig({
test: {
globals: true,
coverage: {
reporter: ['text', 'lcov', 'clover']
}
}
reporter: ['text', 'lcov', 'clover'],
},
},
});
Loading

0 comments on commit 1b6c509

Please sign in to comment.