Skip to content

Commit 0e66e7f

Browse files
committed
build: update build scripts
1 parent dde44f4 commit 0e66e7f

10 files changed

+491
-6418
lines changed

.eslintrc.json

+130-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,41 @@
88
"xo/browser"
99
],
1010
"rules": {
11+
"arrow-body-style": "off",
1112
"capitalized-comments": "off",
13+
"comma-dangle": [
14+
"error",
15+
"never"
16+
],
17+
"import/extensions": [
18+
"error",
19+
"ignorePackages",
20+
{
21+
"js": "always"
22+
}
23+
],
24+
"import/first": "error",
25+
"import/newline-after-import": "error",
26+
"import/no-absolute-path": "error",
27+
"import/no-amd": "error",
28+
"import/no-cycle": [
29+
"error",
30+
{
31+
"ignoreExternal": true
32+
}
33+
],
34+
"import/no-duplicates": "error",
35+
"import/no-extraneous-dependencies": "error",
36+
"import/no-mutable-exports": "error",
37+
"import/no-named-as-default": "error",
38+
"import/no-named-as-default-member": "error",
39+
"import/no-named-default": "error",
40+
"import/no-self-import": "error",
41+
"import/no-unassigned-import": [
42+
"error"
43+
],
44+
"import/no-useless-path-segments": "error",
45+
"import/order": "error",
1246
"indent": [
1347
"error",
1448
2,
@@ -32,28 +66,117 @@
3266
}
3367
],
3468
"no-console": "error",
69+
"no-negated-condition": "off",
3570
"object-curly-spacing": [
3671
"error",
3772
"always"
3873
],
74+
"operator-linebreak": [
75+
"error",
76+
"after"
77+
],
78+
"prefer-template": "error",
3979
"semi": [
4080
"error",
4181
"never"
4282
],
43-
"unicorn/consistent-function-scoping": "off",
83+
"strict": "error",
4484
"unicorn/explicit-length-check": "off",
85+
"unicorn/filename-case": "off",
4586
"unicorn/no-array-callback-reference": "off",
46-
"unicorn/no-array-for-each": "off",
47-
"unicorn/no-for-loop": "off",
87+
"unicorn/no-array-method-this-argument": "off",
4888
"unicorn/no-null": "off",
89+
"unicorn/no-typeof-undefined": "off",
4990
"unicorn/no-unused-properties": "error",
50-
"unicorn/no-useless-undefined": "off",
51-
"unicorn/prefer-dom-node-append": "off",
91+
"unicorn/numeric-separators-style": "off",
92+
"unicorn/prefer-array-flat": "off",
93+
"unicorn/prefer-at": "off",
5294
"unicorn/prefer-dom-node-dataset": "off",
53-
"unicorn/prefer-dom-node-remove": "off",
5495
"unicorn/prefer-module": "off",
5596
"unicorn/prefer-query-selector": "off",
5697
"unicorn/prefer-spread": "off",
98+
"unicorn/prefer-string-replace-all": "off",
5799
"unicorn/prevent-abbreviations": "off"
58-
}
100+
},
101+
"overrides": [
102+
{
103+
"files": [
104+
"build/**"
105+
],
106+
"env": {
107+
"browser": false,
108+
"node": true
109+
},
110+
"parserOptions": {
111+
"sourceType": "module"
112+
},
113+
"rules": {
114+
"no-console": "off",
115+
"unicorn/prefer-top-level-await": "off"
116+
}
117+
},
118+
{
119+
"files": [
120+
"js/**"
121+
],
122+
"parserOptions": {
123+
"sourceType": "module"
124+
}
125+
},
126+
{
127+
"files": [
128+
"js/tests/*.js",
129+
"js/tests/integration/rollup*.js"
130+
],
131+
"env": {
132+
"node": true
133+
},
134+
"parserOptions": {
135+
"sourceType": "script"
136+
}
137+
},
138+
{
139+
"files": [
140+
"js/tests/unit/**"
141+
],
142+
"env": {
143+
"jasmine": true
144+
},
145+
"rules": {
146+
"no-console": "off",
147+
"unicorn/consistent-function-scoping": "off",
148+
"unicorn/no-useless-undefined": "off",
149+
"unicorn/prefer-add-event-listener": "off"
150+
}
151+
},
152+
{
153+
"files": [
154+
"js/tests/visual/**"
155+
],
156+
"plugins": [
157+
"html"
158+
],
159+
"settings": {
160+
"html/html-extensions": [
161+
".html"
162+
]
163+
},
164+
"rules": {
165+
"no-console": "off",
166+
"no-new": "off",
167+
"unicorn/no-array-for-each": "off"
168+
}
169+
},
170+
{
171+
"files": [
172+
"scss/tests/**"
173+
],
174+
"env": {
175+
"node": true
176+
},
177+
"parserOptions": {
178+
"sourceType": "script"
179+
}
180+
}
181+
]
59182
}

build/.eslintrc.json

-15
This file was deleted.

build/banner.js

-15
This file was deleted.

build/banner.mjs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import fs from 'node:fs/promises'
2+
import path from 'node:path'
3+
import { fileURLToPath } from 'node:url'
4+
5+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
6+
7+
const pkgJson = path.join(__dirname, '../package.json')
8+
const pkg = JSON.parse(await fs.readFile(pkgJson, 'utf8'))
9+
10+
const year = new Date().getFullYear()
11+
12+
function getBanner(pluginFilename) {
13+
return `/*!
14+
* CoreUI${pluginFilename ? ` ${pluginFilename}` : ''} v${pkg.version} (${pkg.homepage})
15+
* Copyright ${year} ${pkg.author}
16+
* Licensed under MIT (https://github.com/coreui/coreui-chartjs/blob/main/LICENSE)
17+
*/`
18+
}
19+
20+
export default getBanner

build/change-version.js

-84
This file was deleted.

0 commit comments

Comments
 (0)