Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf47c6a8

Browse files
authored
Build: Update ESLint-related packages, fix linting errors
The main change is the new rule in `eslint-config-jquery`:`template-curly-spacing`.Closesgh-5347Refjquery/eslint-config-jquery#21Refgh-5348
1 parent1ad66ae commitf47c6a8

File tree

8 files changed

+333
-125
lines changed

8 files changed

+333
-125
lines changed

‎build/tasks/build.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async function read( filename ) {
4545
// and ensure unix-style path separators
4646
functionmoduleName(filename){
4747
returnfilename
48-
.replace(`${srcFolder}${path.sep}`,"")
48+
.replace(`${srcFolder}${path.sep}`,"")
4949
.replace(/\.js$/,"")
5050
.split(path.sep)
5151
.join(path.posix.sep);
@@ -112,7 +112,7 @@ async function checkExclude( exclude, include ) {
112112

113113
for(constmoduleofexclude){
114114
if(minimum.indexOf(module)!==-1){
115-
thrownewError(`Module \"${module}\" is a minimum requirement.`);
115+
thrownewError(`Module \"${module}\" is a minimum requirement.`);
116116
}
117117

118118
// Exclude all files in the dir of the same name
@@ -152,7 +152,7 @@ async function writeCompiled( { code, dir, filename, version } ) {
152152
.replace(/@DATE/g,newDate().toISOString().replace(/:\d+\.\d+Z$/,"Z"));
153153

154154
awaitfs.promises.writeFile(path.join(dir,filename),compiledContents);
155-
console.log(`[${getTimestamp()}]${filename} v${version} created.`);
155+
console.log(`[${getTimestamp()}]${filename} v${version} created.`);
156156
}
157157

158158
// Build jQuery ECMAScript modules
@@ -187,7 +187,9 @@ async function build( {
187187

188188
// "+[slim.]SHA" is semantically correct
189189
// Add ".dirty" as well if the working dir is not clean
190-
version=`${pkg.version}+${slim ?"slim." :""}${stdout.trim()}${isClean ?"" :".dirty"}`;
190+
version=`${pkg.version}+${slim ?"slim." :""}${stdout.trim()}${
191+
isClean ?"" :".dirty"
192+
}`;
191193
}elseif(slim){
192194
version+="+slim";
193195
}
@@ -204,7 +206,7 @@ async function build( {
204206
if(excluded.includes("exports/global")){
205207
constindex=excluded.indexOf("exports/global");
206208
setOverride(
207-
`${srcFolder}/exports/global.js`,
209+
`${srcFolder}/exports/global.js`,
208210
"import { jQuery } from \"../core.js\";\n\n"+
209211
"jQuery.noConflict = function() {};"
210212
);
@@ -223,12 +225,12 @@ async function build( {
223225
// No name means an anonymous define
224226
constamdExportContents=awaitread("exports/amd.js");
225227
setOverride(
226-
`${srcFolder}/exports/amd.js`,
228+
`${srcFolder}/exports/amd.js`,
227229
amdExportContents.replace(
228230

229231
// Remove the comma for anonymous defines
230232
/(\s*)"jquery"(,\s*)/,
231-
amd ?`$1\"${amd}\"$2` :" "
233+
amd ?`$1\"${amd}\"$2` :" "
232234
)
233235
);
234236
}
@@ -246,11 +248,11 @@ async function build( {
246248
}
247249

248250
constinputOptions={
249-
input:`${srcFolder}/jquery.js`
251+
input:`${srcFolder}/jquery.js`
250252
};
251253

252254
constincludedImports=included
253-
.map((module)=>`import "./${module}.js";`)
255+
.map((module)=>`import "./${module}.js";`)
254256
.join("\n");
255257

256258
constjQueryFileContents=awaitread("jquery.js");
@@ -272,7 +274,7 @@ async function build( {
272274
// Replace excluded modules with empty sources.
273275
for(constmoduleofexcluded){
274276
setOverride(
275-
`${srcFolder}/${module}.js`,
277+
`${srcFolder}/${module}.js`,
276278

277279
// The `selector` module is not removed, but replaced
278280
// with `selector-native`.
@@ -288,7 +290,7 @@ async function build( {
288290
output:[outputOptions],
289291
plugins:[rollupFileOverrides(fileOverrides)],
290292
watch:{
291-
include:`${srcFolder}/**`,
293+
include:`${srcFolder}/**`,
292294
skipWrite:true
293295
}
294296
});

‎build/tasks/compare_size.mjs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async function getCommitHash() {
2424
functiongetBranchHeader(branch,commit){
2525
letbranchHeader=branch.trim();
2626
if(commit){
27-
branchHeader=chalk.bold(branchHeader)+chalk.gray(` @${commit}`);
27+
branchHeader=chalk.bold(branchHeader)+chalk.gray(` @${commit}`);
2828
}else{
2929
branchHeader=chalk.italic(branchHeader);
3030
}
@@ -65,13 +65,13 @@ function saveCache( loc, cache ) {
6565

6666
functioncompareSizes(existing,current,padLength){
6767
if(typeofcurrent!=="number"){
68-
returnchalk.grey(`${existing}`.padStart(padLength));
68+
returnchalk.grey(`${existing}`.padStart(padLength));
6969
}
7070
constdelta=current-existing;
7171
if(delta>0){
72-
returnchalk.red(`+${delta}`.padStart(padLength));
72+
returnchalk.red(`+${delta}`.padStart(padLength));
7373
}
74-
returnchalk.green(`${delta}`.padStart(padLength));
74+
returnchalk.green(`${delta}`.padStart(padLength));
7575
}
7676

7777
functionsortBranches(a,b){
@@ -130,7 +130,7 @@ export async function compareSize( { cache = ".sizecache.json", files } = {} ) {
130130
constsizes=results.map(function(result){
131131
constrawSize=result.raw.toString().padStart(rawPadLength);
132132
constgzSize=result.gz.toString().padStart(gzPadLength);
133-
return`${rawSize}${gzSize}${result.filename}`;
133+
return`${rawSize}${gzSize}${result.filename}`;
134134
});
135135

136136
constcomparisons=Object.keys(sizeCache).sort(sortBranches).map(function(branch){
@@ -146,7 +146,7 @@ export async function compareSize( { cache = ".sizecache.json", files } = {} ) {
146146

147147
constcompareRaw=compareSizes(branchResult.raw,compareResult.raw,rawPadLength);
148148
constcompareGz=compareSizes(branchResult.gz,compareResult.gz,gzPadLength);
149-
return`${compareRaw}${compareGz}${filename}`;
149+
return`${compareRaw}${compareGz}${filename}`;
150150
});
151151

152152
return[
@@ -182,7 +182,7 @@ export async function compareSize( { cache = ".sizecache.json", files } = {} ) {
182182
meta:{ commit},
183183
files:cacheResults(results)
184184
};
185-
console.log(`Saved cache for${branch}.`);
185+
console.log(`Saved cache for${branch}.`);
186186
}
187187

188188
awaitsaveCache(cache,sizeCache);

‎build/tasks/lib/getTimestamp.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ module.exports = function getTimestamp() {
55
consthours=now.getHours().toString().padStart(2,"0");
66
constminutes=now.getMinutes().toString().padStart(2,"0");
77
constseconds=now.getSeconds().toString().padStart(2,"0");
8-
return`${hours}:${minutes}:${seconds}`;
8+
return`${hours}:${minutes}:${seconds}`;
99
};

‎build/tasks/minify.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module.exports = async function minify( { filename, dir, esm } ) {
2424
ecma:esm ?2015 :5,
2525
asciiOnly:true,
2626
comments:false,
27-
preamble:`/*! jQuery${version}`+
27+
preamble:`/*! jQuery${version}`+
2828
" | (c) OpenJS Foundation and other contributors"+
2929
" | jquery.org/license */\n"
3030
},
@@ -63,5 +63,7 @@ module.exports = async function minify( { filename, dir, esm } ) {
6363
processForDist(code,minFilename);
6464
processForDist(map,mapFilename);
6565

66-
console.log(`[${getTimestamp()}]${minFilename}${version} with${mapFilename} created.`);
66+
console.log(`[${getTimestamp()}]${minFilename}${version} with${
67+
mapFilename
68+
} created.`);
6769
};

‎build/tasks/npmcopy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async function npmcopy() {
3535
consttoDir=path.dirname(to);
3636
awaitfs.promises.mkdir(toDir,{recursive:true});
3737
awaitfs.promises.copyFile(from,to);
38-
console.log(`${source}${dest}`);
38+
console.log(`${source}${dest}`);
3939
}
4040
}
4141

‎build/tasks/promises_aplus_tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if ( !verifyNodeVersion() ) {
1111

1212
constcommand=path.resolve(
1313
__dirname,
14-
`../../node_modules/.bin/promises-aplus-tests${os.platform()==="win32" ?".cmd" :""}`
14+
`../../node_modules/.bin/promises-aplus-tests${os.platform()==="win32" ?".cmd" :""}`
1515
);
1616
constargs=["--reporter","dot","--timeout","2000"];
1717
consttests=[

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp