eslint improve

pull/3986/head
Daniel 2021-09-26 16:34:01 +05:30
parent 844e4a6981
commit 466f34c97c
11 changed files with 188 additions and 334 deletions

View File

@ -8,7 +8,12 @@
"xo/browser"
],
"rules": {
"arrow-body-style": "off",
"capitalized-comments": "off",
"comma-dangle": [
"error",
"never"
],
"indent": [
"error",
2,
@ -31,20 +36,36 @@
"properties": false
}
],
"no-eq-null": "off",
"no-negated-condition": "off",
// "no-eq-null": "off",
// "no-negated-condition": "off",
"no-console": "error",
"object-curly-spacing": [
"error",
"always"
],
"prefer-object-spread": "off",
"operator-linebreak": [
"error",
"after"
],
// "prefer-object-spread": "off",
"semi": [
"error",
"never"
],
"unicorn/filename-case": "off",
"unicorn/explicit-length-check": "off",
"unicorn/no-array-callback-reference": "off",
"unicorn/no-array-for-each": "off",
"unicorn/no-array-method-this-argument": "off",
"unicorn/no-for-loop": "off",
"unicorn/no-null": "off",
"unicorn/no-unused-properties": "error",
"unicorn/numeric-separators-style": "off",
"unicorn/prefer-array-flat": "off",
"unicorn/prefer-dom-node-dataset": "off",
"unicorn/prefer-module": "off",
"unicorn/prefer-prototype-methods": "off",
"unicorn/prefer-query-selector": "off",
"unicorn/prefer-spread": "off",
"unicorn/prevent-abbreviations": "off"
},
"overrides": [
@ -55,6 +76,10 @@
"xo-typescript"
],
"rules": {
"@typescript-eslint/comma-dangle": [
"error",
"never"
],
"@typescript-eslint/indent": [
"error",
2,

View File

@ -1,6 +1,4 @@
/* eslint-disable camelcase */
/* eslint-disable no-undef */
/* eslint-disable unicorn/prefer-module */
/* eslint-env node */
const autoprefix = require('autoprefixer')
const browserSync = require('browser-sync').create()
@ -33,26 +31,18 @@ const paths = {
dist: {
base: './dist/',
css: './dist/css',
js: './dist/js',
html: './dist/pages',
assets: './dist/assets',
img: './dist/assets/img',
vendor: './dist/vendor',
},
base: {
base: './',
node: './node_modules',
vendor: './dist/vendor'
},
src: {
base: './src/',
css: './src/css',
html: './src/pages/**/*.html',
assets: './src/assets/**/*.*',
partials: './src/partials/**/*.html',
scss: './src/scss',
ts: './src/ts',
node_modules: './node_modules/',
vendor: './vendor',
nodeModules: './node_modules/'
},
temp: {
base: './.temp/',
@ -60,22 +50,22 @@ const paths = {
js: './.temp/js',
html: './.temp/pages',
assets: './.temp/assets',
vendor: './.temp/vendor',
},
vendor: './.temp/vendor'
}
}
const sassOptions = {
outputStyle: 'expanded',
includePaths: ['./node_modules/'],
includePaths: ['./node_modules/']
}
const postcssOptions = [
autoprefix({ cascade: false }),
autoprefix({ cascade: false })
]
const postcssRtlOptions = [
autoprefix({ cascade: false }),
rtlcss({}),
rtlcss({})
]
// From here Dev mode will Start
@ -99,24 +89,24 @@ const lintScss = () => src([paths.src.scss + '/**/*.scss'], { since: lastRun(lin
.pipe(gulpStylelint({
failAfterError: false,
reporters: [
{ formatter: 'string', console: true },
],
{ formatter: 'string', console: true }
]
}))
const tsCompile = () =>
rollup.rollup({
input: paths.src.ts + '/adminlte.ts',
output: {
banner,
banner
},
plugins: [
rollupTypescript(),
],
rollupTypescript()
]
}).then(bundle => bundle.write({
file: paths.temp.js + '/adminlte.js',
format: 'umd',
name: 'adminlte',
sourcemap: true,
sourcemap: true
}))
// Lint TS
@ -136,8 +126,8 @@ const index = () => src([paths.src.base + '*.html'])
prefix: '@@',
basepath: './src/partials/',
context: {
environment: 'development',
},
environment: 'development'
}
}))
.pipe(dest(paths.temp.base))
.pipe(browserSync.stream())
@ -147,8 +137,8 @@ const html = () => src([paths.src.html])
prefix: '@@',
basepath: './src/partials/',
context: {
environment: 'development',
},
environment: 'development'
}
}))
.pipe(dest(paths.temp.html))
.pipe(browserSync.stream())
@ -157,12 +147,12 @@ const assets = () => src([paths.src.assets])
.pipe(dest(paths.temp.assets))
.pipe(browserSync.stream())
const vendor = () => src(npmDist({ copyUnminified: true }), { base: paths.src.node_modules })
const vendor = () => src(npmDist({ copyUnminified: true }), { base: paths.src.nodeModules })
.pipe(dest(paths.temp.vendor))
const serve = () => {
browserSync.init({
server: paths.temp.base,
server: paths.temp.base
})
watch([paths.src.scss], series(lintScss))
@ -177,10 +167,10 @@ const serve = () => {
// Minify CSS
const minifyDistCss = () => src([
paths.dist.css + '/**/*.css',
paths.dist.css + '/**/*.css'
], {
base: paths.dist.css,
sourcemaps: true,
sourcemaps: true
})
.pipe(cleanCss({ format: { breakWith: 'lf' } }))
.pipe(rename({ suffix: '.min' }))
@ -192,16 +182,16 @@ const minifyDistJs = () =>
rollup.rollup({
input: paths.src.ts + '/adminlte.ts',
output: {
banner,
banner
},
plugins: [
rollupTypescript(),
],
rollupTypescript()
]
}).then(bundle => bundle.write({
file: paths.temp.js + '/adminlte.js',
format: 'umd',
name: 'adminlte',
sourcemap: true,
sourcemap: true
}))
// Copy assets
@ -214,7 +204,7 @@ const cleanDist = () => del([paths.dist.base])
// Compile and copy all scss/css
const copyDistCssAll = () => src([paths.src.scss + '/**/*.scss'], {
base: paths.src.scss,
sourcemaps: true,
sourcemaps: true
})
.pipe(sass(sassOptions).on('error', sass.logError))
.pipe(postcss(postcssOptions))
@ -230,16 +220,16 @@ const copyDistJs = () =>
rollup.rollup({
input: paths.src.ts + '/adminlte.ts',
output: {
banner,
banner
},
plugins: [
rollupTypescript(),
],
rollupTypescript()
]
}).then(bundle => bundle.write({
file: paths.temp.js + '/adminlte.js',
format: 'umd',
name: 'adminlte',
sourcemap: true,
sourcemap: true
}))
// Copy Html
@ -248,8 +238,8 @@ const copyDistHtml = () => src([paths.src.html])
prefix: '@@',
basepath: './src/partials/',
context: {
environment: 'production',
},
environment: 'production'
}
}))
.pipe(dest(paths.dist.html))
@ -259,13 +249,13 @@ const copyDistHtmlIndex = () => src([paths.src.base + '*.html'])
prefix: '@@',
basepath: './src/partials/',
context: {
environment: 'production',
},
environment: 'production'
}
}))
.pipe(dest(paths.dist.base))
// Copy node_modules to vendor
const copyDistVendor = () => src(npmDist({ copyUnminified: true }), { base: paths.src.node_modules })
const copyDistVendor = () => src(npmDist({ copyUnminified: true }), { base: paths.src.nodeModules })
.pipe(dest(paths.dist.vendor))
// To Dist Before release

357
package-lock.json generated
View File

@ -519,13 +519,13 @@
"dev": true
},
"@typescript-eslint/eslint-plugin": {
"version": "4.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.0.tgz",
"integrity": "sha512-iPKZTZNavAlOhfF4gymiSuUkgLne/nh5Oz2/mdiUmuZVD42m9PapnCnzjxuDsnpnbH3wT5s2D8bw6S39TC6GNw==",
"version": "4.31.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.2.tgz",
"integrity": "sha512-w63SCQ4bIwWN/+3FxzpnWrDjQRXVEGiTt9tJTRptRXeFvdZc/wLiz3FQUwNQ2CVoRGI6KUWMNUj/pk63noUfcA==",
"dev": true,
"requires": {
"@typescript-eslint/experimental-utils": "4.31.0",
"@typescript-eslint/scope-manager": "4.31.0",
"@typescript-eslint/experimental-utils": "4.31.2",
"@typescript-eslint/scope-manager": "4.31.2",
"debug": "^4.3.1",
"functional-red-black-tree": "^1.0.1",
"regexpp": "^3.1.0",
@ -534,55 +534,55 @@
}
},
"@typescript-eslint/experimental-utils": {
"version": "4.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.0.tgz",
"integrity": "sha512-Hld+EQiKLMppgKKkdUsLeVIeEOrwKc2G983NmznY/r5/ZtZCDvIOXnXtwqJIgYz/ymsy7n7RGvMyrzf1WaSQrw==",
"version": "4.31.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.2.tgz",
"integrity": "sha512-3tm2T4nyA970yQ6R3JZV9l0yilE2FedYg8dcXrTar34zC9r6JB7WyBQbpIVongKPlhEMjhQ01qkwrzWy38Bk1Q==",
"dev": true,
"requires": {
"@types/json-schema": "^7.0.7",
"@typescript-eslint/scope-manager": "4.31.0",
"@typescript-eslint/types": "4.31.0",
"@typescript-eslint/typescript-estree": "4.31.0",
"@typescript-eslint/scope-manager": "4.31.2",
"@typescript-eslint/types": "4.31.2",
"@typescript-eslint/typescript-estree": "4.31.2",
"eslint-scope": "^5.1.1",
"eslint-utils": "^3.0.0"
}
},
"@typescript-eslint/parser": {
"version": "4.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.31.0.tgz",
"integrity": "sha512-oWbzvPh5amMuTmKaf1wp0ySxPt2ZXHnFQBN2Szu1O//7LmOvgaKTCIDNLK2NvzpmVd5A2M/1j/rujBqO37hj3w==",
"version": "4.31.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.31.2.tgz",
"integrity": "sha512-EcdO0E7M/sv23S/rLvenHkb58l3XhuSZzKf6DBvLgHqOYdL6YFMYVtreGFWirxaU2mS1GYDby3Lyxco7X5+Vjw==",
"dev": true,
"requires": {
"@typescript-eslint/scope-manager": "4.31.0",
"@typescript-eslint/types": "4.31.0",
"@typescript-eslint/typescript-estree": "4.31.0",
"@typescript-eslint/scope-manager": "4.31.2",
"@typescript-eslint/types": "4.31.2",
"@typescript-eslint/typescript-estree": "4.31.2",
"debug": "^4.3.1"
}
},
"@typescript-eslint/scope-manager": {
"version": "4.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.31.0.tgz",
"integrity": "sha512-LJ+xtl34W76JMRLjbaQorhR0hfRAlp3Lscdiz9NeI/8i+q0hdBZ7BsiYieLoYWqy+AnRigaD3hUwPFugSzdocg==",
"version": "4.31.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.31.2.tgz",
"integrity": "sha512-2JGwudpFoR/3Czq6mPpE8zBPYdHWFGL6lUNIGolbKQeSNv4EAiHaR5GVDQaLA0FwgcdcMtRk+SBJbFGL7+La5w==",
"dev": true,
"requires": {
"@typescript-eslint/types": "4.31.0",
"@typescript-eslint/visitor-keys": "4.31.0"
"@typescript-eslint/types": "4.31.2",
"@typescript-eslint/visitor-keys": "4.31.2"
}
},
"@typescript-eslint/types": {
"version": "4.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.31.0.tgz",
"integrity": "sha512-9XR5q9mk7DCXgXLS7REIVs+BaAswfdHhx91XqlJklmqWpTALGjygWVIb/UnLh4NWhfwhR5wNe1yTyCInxVhLqQ==",
"version": "4.31.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.31.2.tgz",
"integrity": "sha512-kWiTTBCTKEdBGrZKwFvOlGNcAsKGJSBc8xLvSjSppFO88AqGxGNYtF36EuEYG6XZ9vT0xX8RNiHbQUKglbSi1w==",
"dev": true
},
"@typescript-eslint/typescript-estree": {
"version": "4.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.0.tgz",
"integrity": "sha512-QHl2014t3ptg+xpmOSSPn5hm4mY8D4s97ftzyk9BZ8RxYQ3j73XcwuijnJ9cMa6DO4aLXeo8XS3z1omT9LA/Eg==",
"version": "4.31.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.2.tgz",
"integrity": "sha512-ieBq8U9at6PvaC7/Z6oe8D3czeW5d//Fo1xkF/s9394VR0bg/UaMYPdARiWyKX+lLEjY3w/FNZJxitMsiWv+wA==",
"dev": true,
"requires": {
"@typescript-eslint/types": "4.31.0",
"@typescript-eslint/visitor-keys": "4.31.0",
"@typescript-eslint/types": "4.31.2",
"@typescript-eslint/visitor-keys": "4.31.2",
"debug": "^4.3.1",
"globby": "^11.0.3",
"is-glob": "^4.0.1",
@ -591,12 +591,12 @@
}
},
"@typescript-eslint/visitor-keys": {
"version": "4.31.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.0.tgz",
"integrity": "sha512-HUcRp2a9I+P21+O21yu3ezv3GEPGjyGiXoEUQwZXjR8UxRApGeLyWH4ZIIUSalE28aG4YsV6GjtaAVB3QKOu0w==",
"version": "4.31.2",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.2.tgz",
"integrity": "sha512-PrBId7EQq2Nibns7dd/ch6S6/M4/iwLM9McbgeEbCXfxdwRUNxJ4UNreJ6Gh3fI2GNKNrWnQxKL7oCPmngKBug==",
"dev": true,
"requires": {
"@typescript-eslint/types": "4.31.0",
"@typescript-eslint/types": "4.31.2",
"eslint-visitor-keys": "^2.0.0"
}
},
@ -931,54 +931,51 @@
"dev": true
},
"autoprefixer": {
"version": "10.3.4",
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.3.4.tgz",
"integrity": "sha512-EKjKDXOq7ug+jagLzmnoTRpTT0q1KVzEJqrJd0hCBa7FiG0WbFOBCcJCy2QkW1OckpO3qgttA1aWjVbeIPAecw==",
"version": "10.3.5",
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.3.5.tgz",
"integrity": "sha512-2H5kQSsyoOMdIehTzIt/sC9ZDIgWqlkG/dbevm9B9xQZ1TDPBHpNUDW5ENqqQQzuaBWEo75JkV0LJe+o5Lnr5g==",
"dev": true,
"requires": {
"browserslist": "^4.16.8",
"caniuse-lite": "^1.0.30001252",
"colorette": "^1.3.0",
"browserslist": "^4.17.1",
"caniuse-lite": "^1.0.30001259",
"fraction.js": "^4.1.1",
"nanocolors": "^0.1.5",
"normalize-range": "^0.1.2",
"postcss-value-parser": "^4.1.0"
},
"dependencies": {
"browserslist": {
"version": "4.16.8",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.8.tgz",
"integrity": "sha512-sc2m9ohR/49sWEbPj14ZSSZqp+kbi16aLao42Hmn3Z8FpjuMaq2xCA2l4zl9ITfyzvnvyE0hcg62YkIGKxgaNQ==",
"version": "4.17.1",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.1.tgz",
"integrity": "sha512-aLD0ZMDSnF4lUt4ZDNgqi5BUn9BZ7YdQdI/cYlILrhdSSZJLU9aNZoD5/NBmM4SK34APB2e83MOsRt1EnkuyaQ==",
"dev": true,
"requires": {
"caniuse-lite": "^1.0.30001251",
"colorette": "^1.3.0",
"electron-to-chromium": "^1.3.811",
"caniuse-lite": "^1.0.30001259",
"electron-to-chromium": "^1.3.846",
"escalade": "^3.1.1",
"node-releases": "^1.1.75"
"nanocolors": "^0.1.5",
"node-releases": "^1.1.76"
}
},
"caniuse-lite": {
"version": "1.0.30001254",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001254.tgz",
"integrity": "sha512-GxeHOvR0LFMYPmFGA+NiTOt9uwYDxB3h154tW2yBYwfz2EMX3i1IBgr6gmJGfU0K8KQsqPa5XqLD8zVdP5lUzA==",
"dev": true
},
"colorette": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/colorette/-/colorette-1.3.0.tgz",
"integrity": "sha512-ecORCqbSFP7Wm8Y6lyqMJjexBQqXSF7SSeaTyGGphogUjBlFP9m9o08wy86HL2uB7fMTxtOUzLMk7ogKcxMg1w==",
"dev": true
"version": "1.0.30001260",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001260.tgz",
"integrity": "sha512-Fhjc/k8725ItmrvW5QomzxLeojewxvqiYCKeFcfFEhut28IVLdpHU19dneOmltZQIE5HNbawj1HYD+1f2bM1Dg==",
"dev": true,
"requires": {
"nanocolors": "^0.1.0"
}
},
"electron-to-chromium": {
"version": "1.3.830",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.830.tgz",
"integrity": "sha512-gBN7wNAxV5vl1430dG+XRcQhD4pIeYeak6p6rjdCtlz5wWNwDad8jwvphe5oi1chL5MV6RNRikfffBBiFuj+rQ==",
"version": "1.3.850",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.850.tgz",
"integrity": "sha512-ZzkDcdzePeF4dhoGZQT77V2CyJOpwfTZEOg4h0x6R/jQhGt/rIRpbRyVreWLtD7B/WsVxo91URm2WxMKR9JQZA==",
"dev": true
},
"node-releases": {
"version": "1.1.75",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.75.tgz",
"integrity": "sha512-Qe5OUajvqrqDSy6wrWFmMwfJ0jVgwiw4T3KqmbTcZ62qW0gQkheXYhcFM1+lOVcGUoRxcEcfyvFMAnDgaF1VWw==",
"version": "1.1.76",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.76.tgz",
"integrity": "sha512-9/IECtNr8dXNmPWmFXepT0/7o5eolGesHUa3mtr0KlgnCvnZxwh2qensKL42JJY2vQKC3nIBXetFAqR+PW1CmA==",
"dev": true
}
}
@ -5478,12 +5475,6 @@
"integrity": "sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==",
"dev": true
},
"memorystream": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz",
"integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=",
"dev": true
},
"merge-stream": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
@ -5635,12 +5626,29 @@
"dev": true,
"optional": true
},
"nanoid": {
"version": "3.1.23",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz",
"integrity": "sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==",
"nanocolors": {
"version": "0.1.12",
"resolved": "https://registry.npmjs.org/nanocolors/-/nanocolors-0.1.12.tgz",
"integrity": "sha512-2nMHqg1x5PU+unxX7PGY7AuYxl2qDx7PSrTRjizr8sxdd3l/3hBuWWaki62qmtYm2U5i4Z5E7GbjlyDFhs9/EQ==",
"dev": true
},
"nanoid": {
"version": "3.1.26",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.26.tgz",
"integrity": "sha512-f2KGmBOi1LcVIg7mz8tBR5Ma1cu+gnMk3dS13Ig5gAUbp4Ia5Zpci6KvNgy4nJMN9jR1ELw/YU7X3dRzE18aQQ==",
"dev": true,
"requires": {
"nanocolors": "^0.2.6"
},
"dependencies": {
"nanocolors": {
"version": "0.2.6",
"resolved": "https://registry.npmjs.org/nanocolors/-/nanocolors-0.2.6.tgz",
"integrity": "sha512-lP8hjPSXTQ7qpYl5hFPVTBXGdd7+Rn3oi8GqIPNZP63L09tewRzWYFxAy26B1BYOOYaPWgmVF/BFIhDAHihwUQ==",
"dev": true
}
}
},
"nanomatch": {
"version": "1.2.13",
"resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz",
@ -5678,12 +5686,6 @@
"integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=",
"dev": true
},
"nice-try": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
"dev": true
},
"node-releases": {
"version": "1.1.73",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.73.tgz",
@ -5737,150 +5739,6 @@
"once": "^1.3.2"
}
},
"npm-run-all": {
"version": "4.1.5",
"resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz",
"integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==",
"dev": true,
"requires": {
"ansi-styles": "^3.2.1",
"chalk": "^2.4.1",
"cross-spawn": "^6.0.5",
"memorystream": "^0.3.1",
"minimatch": "^3.0.4",
"pidtree": "^0.3.0",
"read-pkg": "^3.0.0",
"shell-quote": "^1.6.1",
"string.prototype.padend": "^3.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"requires": {
"color-convert": "^1.9.0"
}
},
"chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
"requires": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
}
},
"color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"requires": {
"color-name": "1.1.3"
}
},
"color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
"dev": true
},
"cross-spawn": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
"dev": true,
"requires": {
"nice-try": "^1.0.4",
"path-key": "^2.0.1",
"semver": "^5.5.0",
"shebang-command": "^1.2.0",
"which": "^1.2.9"
}
},
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"dev": true
},
"path-key": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
"dev": true
},
"path-type": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz",
"integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==",
"dev": true,
"requires": {
"pify": "^3.0.0"
}
},
"pify": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
"integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
"dev": true
},
"read-pkg": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
"integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=",
"dev": true,
"requires": {
"load-json-file": "^4.0.0",
"normalize-package-data": "^2.3.2",
"path-type": "^3.0.0"
}
},
"semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"dev": true
},
"shebang-command": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
"integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
"dev": true,
"requires": {
"shebang-regex": "^1.0.0"
}
},
"shebang-regex": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
"dev": true
},
"supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"requires": {
"has-flag": "^3.0.0"
}
},
"which": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
"dev": true,
"requires": {
"isexe": "^2.0.0"
}
}
}
},
"num2fraction": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz",
@ -6257,12 +6115,6 @@
"integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==",
"dev": true
},
"pidtree": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz",
"integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==",
"dev": true
},
"pify": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
@ -6450,14 +6302,22 @@
"dev": true
},
"postcss": {
"version": "8.3.6",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.6.tgz",
"integrity": "sha512-wG1cc/JhRgdqB6WHEuyLTedf3KIRuD0hG6ldkFEZNCjRxiC+3i6kkWUUbiJQayP28iwG35cEmAbe98585BYV0A==",
"version": "8.3.8",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.3.8.tgz",
"integrity": "sha512-GT5bTjjZnwDifajzczOC+r3FI3Cu+PgPvrsjhQdRqa2kTJ4968/X9CUce9xttIB0xOs5c6xf0TCWZo/y9lF6bA==",
"dev": true,
"requires": {
"colorette": "^1.2.2",
"nanoid": "^3.1.23",
"nanocolors": "^0.2.2",
"nanoid": "^3.1.25",
"source-map-js": "^0.6.2"
},
"dependencies": {
"nanocolors": {
"version": "0.2.6",
"resolved": "https://registry.npmjs.org/nanocolors/-/nanocolors-0.2.6.tgz",
"integrity": "sha512-lP8hjPSXTQ7qpYl5hFPVTBXGdd7+Rn3oi8GqIPNZP63L09tewRzWYFxAy26B1BYOOYaPWgmVF/BFIhDAHihwUQ==",
"dev": true
}
}
},
"postcss-html": {
@ -7352,9 +7212,9 @@
}
},
"rollup": {
"version": "2.56.3",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.56.3.tgz",
"integrity": "sha512-Au92NuznFklgQCUcV96iXlxUbHuB1vQMaH76DHl5M11TotjOHwqk9CwcrT78+Tnv4FN9uTBxq6p4EJoYkpyekg==",
"version": "2.57.0",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.57.0.tgz",
"integrity": "sha512-bKQIh1rWKofRee6mv8SrF2HdP6pea5QkwBZSMImJysFj39gQuiV8MEPBjXOCpzk3wSYp63M2v2wkWBmFC8O/rg==",
"dev": true,
"requires": {
"fsevents": "~2.3.2"
@ -7486,9 +7346,9 @@
"dev": true
},
"sass": {
"version": "1.39.2",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.39.2.tgz",
"integrity": "sha512-4/6Vn2RPc+qNwSclUSKvssh7dqK1Ih3FfHBW16I/GfH47b3scbYeOw65UIrYG7PkweFiKbpJjgkf5CV8EMmvzw==",
"version": "1.42.1",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.42.1.tgz",
"integrity": "sha512-/zvGoN8B7dspKc5mC6HlaygyCBRvnyzzgD5khiaCfglWztY99cYoiTUksVx11NlnemrcfH5CEaCpsUKoW0cQqg==",
"dev": true,
"requires": {
"chokidar": ">=3.0.0 <4.0.0"
@ -7710,12 +7570,6 @@
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"dev": true
},
"shell-quote": {
"version": "1.7.2",
"resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.2.tgz",
"integrity": "sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==",
"dev": true
},
"signal-exit": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
@ -8157,17 +8011,6 @@
}
}
},
"string.prototype.padend": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.2.tgz",
"integrity": "sha512-/AQFLdYvePENU3W5rgurfWSMU6n+Ww8n/3cUt7E+vPBB/D7YDG8x+qjoFs4M/alR2bW7Qg6xMjVwWUOvuQ0XpQ==",
"dev": true,
"requires": {
"call-bind": "^1.0.2",
"define-properties": "^1.1.3",
"es-abstract": "^1.18.0-next.2"
}
},
"string.prototype.trimend": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz",

View File

@ -7,11 +7,7 @@
"main": "dist/js/adminlte.min.js",
"scripts": {
"bundlewatch": "bundlewatch --config .bundlewatch.config.json",
"css-lint": "stylelint \"src/scss/**/*.scss\" --cache --cache-location .cache/.stylelintcache",
"lockfile-lint": "lockfile-lint --allowed-hosts npm --allowed-schemes https: --empty-hostname false --type npm --path package-lock.json",
"ts:type-check": "tsc --noEmit",
"js-lint": "eslint --ext=js,ts --cache --cache-location .cache/.eslintcache --report-unused-disable-directives .",
"lint": "npm-run-all --continue-on-error --parallel css-lint js-lint ts:type-check lockfile-lint"
"lockfile-lint": "lockfile-lint --allowed-hosts npm --allowed-schemes https: --empty-hostname false --type npm --path package-lock.json"
},
"keywords": [
"css",
@ -43,9 +39,9 @@
},
"devDependencies": {
"@rollup/plugin-typescript": "^8.2.5",
"@typescript-eslint/eslint-plugin": "^4.31.0",
"@typescript-eslint/parser": "^4.31.0",
"autoprefixer": "^10.3.4",
"@typescript-eslint/eslint-plugin": "^4.31.2",
"@typescript-eslint/parser": "^4.31.2",
"autoprefixer": "^10.3.5",
"browser-sync": "^2.27.5",
"bundlewatch": "^0.3.2",
"del": "^6.0.0",
@ -65,11 +61,10 @@
"gulp-sass": "^5.0.0",
"gulp-stylelint": "^13.0.0",
"lockfile-lint": "^4.6.2",
"npm-run-all": "^4.1.5",
"postcss": "^8.3.6",
"rollup": "^2.56.3",
"postcss": "^8.3.8",
"rollup": "^2.57.0",
"rtlcss": "^3.3.0",
"sass": "^1.39.2",
"sass": "^1.42.1",
"stylelint": "^13.13.1",
"stylelint-config-twbs-bootstrap": "^2.2.3",
"typescript": "^4.4.3"

View File

@ -9,7 +9,7 @@ export {
PushMenu,
Treeview,
DirectChat,
CardWidget,
CardWidget
}
//

View File

@ -8,7 +8,7 @@
import {
domReady,
slideUp,
slideDown,
slideDown
} from './util/index'
/**
@ -39,7 +39,7 @@ const Default = {
collapseIcon: 'fa-minus',
expandIcon: 'fa-plus',
maximizeIcon: 'fa-expand',
minimizeIcon: 'fa-compress',
minimizeIcon: 'fa-compress'
}
interface Config {
@ -65,7 +65,7 @@ class CardWidget {
this._parent = element
}
this._config = Object.assign({}, Default, config)
this._config = {...Default, ...config}
}
collapse() {

View File

@ -6,7 +6,7 @@
*/
import {
domReady,
domReady
} from './util/index'
/**

View File

@ -6,7 +6,7 @@
*/
import {
domReady,
domReady
} from './util/index'
/**
@ -21,7 +21,7 @@ const SELECTOR_SIDEBAR = '.sidebar'
const Default = {
scrollbarTheme: 'os-theme-light',
scrollbarAutoHide: 'leave',
scrollbarAutoHide: 'leave'
}
interface Config {
@ -40,7 +40,7 @@ class Layout {
constructor(element: HTMLElement, config: Config) {
this._element = element
this._config = Object.assign({}, Default, config)
this._config = {...Default, ...config}
}
holdTransition(): void {
@ -69,8 +69,8 @@ domReady(() => {
sizeAutoCapable: true,
scrollbars: {
autoHide: Default.scrollbarAutoHide,
clickScrolling: true,
},
clickScrolling: true
}
})
}
})

View File

@ -6,7 +6,7 @@
*/
import {
domReady,
domReady
} from './util/index'
/**
@ -37,7 +37,7 @@ const SELECTOR_SIDEBAR_SM = `.${CLASS_NAME_LAYOUT_MOBILE}`
const SELECTOR_CONTENT_WRAPPER = '.content-wrapper'
const Defaults = {
onLayouMobile: 992,
onLayouMobile: 992
}
/**

View File

@ -8,7 +8,7 @@
import {
domReady,
slideDown,
slideUp,
slideUp
} from './util/index'
/**
@ -32,7 +32,7 @@ const SELECTOR_TREEVIEW_MENU = '.nav-treeview'
const SELECTOR_DATA_TOGGLE = '[data-lte-toggle="treeview"]'
const Default = {
animationSpeed: 300,
animationSpeed: 300
}
interface Config {

View File

@ -47,6 +47,7 @@ const slideUp = (target: HTMLElement, duration = 500) => {
const slideDown = (target: HTMLElement, duration = 500) => {
target.style.removeProperty('display')
let {display} = window.getComputedStyle(target)
if (display === 'none') {
display = 'block'
}
@ -94,5 +95,5 @@ export {
windowReady,
slideUp,
slideDown,
slideToggle,
slideToggle
}