mirror of
https://github.com/kamranahmedse/driver.js.git
synced 2026-10-31 03:52:13 +08:00
Remove linting
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
.history
|
||||
.husky
|
||||
.vscode
|
||||
coverage
|
||||
dist
|
||||
node_modules
|
||||
vite.config.ts
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"root": true,
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"plugins": ["@typescript-eslint", "prettier"],
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"prettier"
|
||||
],
|
||||
"env": {
|
||||
"browser": true,
|
||||
"node": true
|
||||
},
|
||||
"rules": {
|
||||
"prettier/prettier": "error"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
npx lint-staged
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"./**/*.{ts,html,json}": "npm run format:scripts",
|
||||
"./**/*.{css,scss}": "npm run format:styles"
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
.history
|
||||
.husky
|
||||
.vscode
|
||||
coverage
|
||||
dist
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"printWidth": 80,
|
||||
"printWidth": 120,
|
||||
"tabWidth": 2,
|
||||
"singleQuote": false,
|
||||
"trailingComma": "es5",
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
.history
|
||||
.husky
|
||||
.vscode
|
||||
coverage
|
||||
dist
|
||||
node_modules
|
||||
vite.config.ts
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"plugins": ["stylelint-prettier"],
|
||||
"extends": [
|
||||
"stylelint-config-recommended",
|
||||
"stylelint-config-sass-guidelines",
|
||||
"stylelint-config-prettier"
|
||||
],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["**/*.scss"],
|
||||
"customSyntax": "postcss-scss"
|
||||
}
|
||||
],
|
||||
"rules": {
|
||||
"prettier/prettier": true,
|
||||
"function-parentheses-space-inside": null,
|
||||
"no-descending-specificity": null,
|
||||
"max-nesting-depth": 2,
|
||||
"selector-max-id": 1
|
||||
}
|
||||
}
|
||||
+1
-19
@@ -15,34 +15,16 @@
|
||||
"build": "tsc && vite build && dts-bundle-generator --config ./dts-bundle-generator.config.ts",
|
||||
"test": "vitest",
|
||||
"test:coverage": "vitest --coverage",
|
||||
"lint:scripts": "eslint . --ext .ts",
|
||||
"lint:styles": "stylelint ./**/*.{css,scss}",
|
||||
"format:scripts": "prettier . --write",
|
||||
"format:styles": "stylelint ./**/*.{css,scss} --fix",
|
||||
"format": "npm run format:scripts && npm run format:styles",
|
||||
"prepare": "husky install && husky set .husky/pre-commit 'npx lint-staged' && git add .husky/pre-commit",
|
||||
"uninstall-husky": "npm uninstall husky --no-save && git config --unset core.hooksPath && npx rimraf .husky"
|
||||
"format": "prettier . --write"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jsdom": "^21.1.1",
|
||||
"@types/node": "^20.1.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
||||
"@typescript-eslint/parser": "^5.59.2",
|
||||
"@vitest/coverage-c8": "^0.31.0",
|
||||
"dts-bundle-generator": "^8.0.1",
|
||||
"eslint": "^8.40.0",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"husky": "^8.0.3",
|
||||
"lint-staged": "^13.2.2",
|
||||
"postcss": "^8.4.23",
|
||||
"postcss-scss": "^4.0.6",
|
||||
"prettier": "^2.8.8",
|
||||
"stylelint": "^15.6.1",
|
||||
"stylelint-config-prettier": "^9.0.5",
|
||||
"stylelint-config-recommended": "^12.0.0",
|
||||
"stylelint-config-sass-guidelines": "^10.0.0",
|
||||
"stylelint-prettier": "^3.0.0",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^5.0.4",
|
||||
"vite": "^4.3.5",
|
||||
|
||||
+27
-5
@@ -50,13 +50,35 @@ export function refreshPopover(element: Element) {
|
||||
const popoverArrow = popover.arrow;
|
||||
|
||||
// const position = calculatePopoverPosition(element);
|
||||
popoverArrow?.classList.add(
|
||||
"driver-popover-arrow-side-bottom",
|
||||
"driver-popover-arrow-align-center"
|
||||
);
|
||||
popoverArrow?.classList.add("driver-popover-arrow-side-bottom", "driver-popover-arrow-align-center");
|
||||
}
|
||||
|
||||
function calculatePopoverPosition(element: Element) {}
|
||||
function calculatePopoverPosition(element: Element) {
|
||||
if (!popover) {
|
||||
return;
|
||||
}
|
||||
|
||||
const popoverPadding = 10;
|
||||
|
||||
const popoverDimensions = popover.wrapper.getBoundingClientRect();
|
||||
const popoverArrowDimensions = popover.arrow.getBoundingClientRect();
|
||||
const elementDimensions = element.getBoundingClientRect();
|
||||
|
||||
const popoverWidth = popoverDimensions.width + popoverPadding;
|
||||
const popoverHeight = popoverDimensions.height + popoverPadding;
|
||||
|
||||
const topValue = elementDimensions.top - popoverHeight;
|
||||
const isTopOptimal = topValue >= 0;
|
||||
|
||||
const bottomValue = window.innerHeight - (elementDimensions.bottom + popoverHeight);
|
||||
const isBottomOptimal = bottomValue >= 0;
|
||||
|
||||
const leftValue = elementDimensions.left - popoverWidth;
|
||||
const isLeftOptimal = leftValue >= 0;
|
||||
|
||||
const rightValue = window.innerWidth - (elementDimensions.right + popoverWidth);
|
||||
const isRightOptimal = rightValue >= 0;
|
||||
}
|
||||
|
||||
function createPopover(): PopoverDOM {
|
||||
const wrapper = document.createElement("div");
|
||||
|
||||
Reference in New Issue
Block a user