mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Merge pull request #6213 from marc1706/ticket/16775
[ticket/16775] Run xo linter in GitHub Actions runs
This commit is contained in:
commit
8e23e70f12
7 changed files with 3163 additions and 15276 deletions
18
.github/check-js.sh
vendored
Executable file
18
.github/check-js.sh
vendored
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# This file is part of the phpBB Forum Software package.
|
||||
#
|
||||
# @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||
# @license GNU General Public License, version 2 (GPL-2.0)
|
||||
#
|
||||
# For full copyright and license information, please see
|
||||
# the docs/CREDITS.txt file.
|
||||
#
|
||||
set -e
|
||||
set +x
|
||||
|
||||
sudo npm install -g > /dev/null
|
||||
npm ci > /dev/null
|
||||
set -x
|
||||
node_modules/eslint/bin/eslint.js "phpBB/**/*.js"
|
||||
node_modules/eslint/bin/eslint.js "gulpfile.js"
|
4
.github/workflows/tests.yml
vendored
4
.github/workflows/tests.yml
vendored
|
@ -84,6 +84,10 @@ jobs:
|
|||
run: |
|
||||
.github/check-stylesheet.sh
|
||||
|
||||
- name: Lint JavaScript files
|
||||
run: |
|
||||
.github/check-js.sh
|
||||
|
||||
- name: Check commit message
|
||||
if: github.event_name == 'pull_request'
|
||||
run: |
|
||||
|
|
68
gulpfile.js
68
gulpfile.js
|
@ -1,47 +1,57 @@
|
|||
'use strict';
|
||||
|
||||
const del = require('del');
|
||||
const gulp = require('gulp');
|
||||
const autoprefixer = require('autoprefixer');
|
||||
// const sass = require('gulp-sass');
|
||||
const rename = require('gulp-rename');
|
||||
const sourcemaps = require('gulp-sourcemaps');
|
||||
const cssnano = require('cssnano');
|
||||
const concat = require('gulp-concat-css');
|
||||
const postcss = require('gulp-postcss');
|
||||
const autoprefixer = require('autoprefixer');
|
||||
const cssnano = require('cssnano');
|
||||
const sorting = require('postcss-sorting');
|
||||
const atimport = require('postcss-import');
|
||||
// const torem = require('postcss-pxtorem');
|
||||
const sortOrder = require('./.postcss-sorting.json');
|
||||
// const pkg = require('./package.json');
|
||||
|
||||
// Config
|
||||
const build = {
|
||||
const paths = {
|
||||
styles: {
|
||||
src: './phpBB/styles/prosilver/theme/*.css',
|
||||
css: './phpBB/styles/prosilver/theme/',
|
||||
},
|
||||
};
|
||||
|
||||
gulp.task('css', gulp.series(() => {
|
||||
return gulp
|
||||
.src(build.css + '*.css')
|
||||
function styles() {
|
||||
return gulp.src(paths.styles.src)
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(
|
||||
postcss([
|
||||
autoprefixer(),
|
||||
sorting(sortOrder),
|
||||
]),
|
||||
)
|
||||
.pipe(gulp.dest(build.css));
|
||||
}));
|
||||
.pipe(sourcemaps.write('./'))
|
||||
.pipe(gulp.dest(paths.styles.css));
|
||||
}
|
||||
|
||||
gulp.task('clean', gulp.series(() => {
|
||||
del([ 'dist' ]);
|
||||
}));
|
||||
|
||||
gulp.task('minify', gulp.series(() => {
|
||||
return gulp
|
||||
.src(build.css + '/bidi.css')
|
||||
function minify() {
|
||||
return gulp.src([
|
||||
paths.styles.css + 'normalize.css',
|
||||
paths.styles.css + 'base.css',
|
||||
paths.styles.css + 'utilities.css',
|
||||
paths.styles.css + 'icons.css',
|
||||
paths.styles.css + 'common.css',
|
||||
paths.styles.css + 'buttons.css',
|
||||
paths.styles.css + 'links.css',
|
||||
paths.styles.css + 'mentions.css',
|
||||
paths.styles.css + 'content.css',
|
||||
paths.styles.css + 'cp.css',
|
||||
paths.styles.css + 'forms.css',
|
||||
paths.styles.css + 'colours.css',
|
||||
paths.styles.css + 'responsive.css',
|
||||
paths.styles.css + 'bidi.css',
|
||||
])
|
||||
.pipe(sourcemaps.init())
|
||||
.pipe(concat('stylesheet.css'))
|
||||
.pipe(
|
||||
postcss([
|
||||
atimport(),
|
||||
cssnano(),
|
||||
]),
|
||||
)
|
||||
|
@ -50,11 +60,15 @@ gulp.task('minify', gulp.series(() => {
|
|||
extname: '.css',
|
||||
}))
|
||||
.pipe(sourcemaps.write('./'))
|
||||
.pipe(gulp.dest(build.css));
|
||||
}));
|
||||
.pipe(gulp.dest(paths.styles.css));
|
||||
}
|
||||
|
||||
gulp.task('watch', gulp.series(() => {
|
||||
gulp.watch('phpBB/styles/prosilver/theme/*.css', gulp.series('css'));
|
||||
}));
|
||||
function watch() {
|
||||
gulp.watch(paths.styles.src, styles);
|
||||
}
|
||||
|
||||
gulp.task('default', gulp.series('css', 'watch'));
|
||||
exports.style = styles;
|
||||
exports.minify = minify;
|
||||
exports.watch = watch;
|
||||
|
||||
exports.default = gulp.series(styles, minify, watch);
|
||||
|
|
18242
package-lock.json
generated
18242
package-lock.json
generated
File diff suppressed because it is too large
Load diff
79
package.json
79
package.json
|
@ -6,58 +6,24 @@
|
|||
"directories": {
|
||||
"doc": "docs"
|
||||
},
|
||||
"xo": {
|
||||
"ignores": [
|
||||
"./**/adm/style/admin.js",
|
||||
"./**/adm/style/ajax.js",
|
||||
"./**/adm/style/permissions.js",
|
||||
"./**/adm/style/tooltip.js",
|
||||
"./**/assets/javascript/core.js",
|
||||
"./**/assets/javascript/editor.js",
|
||||
"./**/assets/javascript/installer.js",
|
||||
"./**/assets/javascript/plupload.js",
|
||||
"./**/styles/prosilver/template/ajax.js",
|
||||
"./**/styles/prosilver/template/forum_fn.js",
|
||||
"./**/phpbb/**/*.js",
|
||||
"./**/tests/**/*.js"
|
||||
],
|
||||
"rules": {
|
||||
"quotes": [
|
||||
"error",
|
||||
"single"
|
||||
],
|
||||
"comma-dangle": [
|
||||
"error",
|
||||
"always-multiline"
|
||||
],
|
||||
"max-params": [
|
||||
"error",
|
||||
6
|
||||
],
|
||||
"block-spacing": "error",
|
||||
"array-bracket-spacing": [
|
||||
"error",
|
||||
"always"
|
||||
],
|
||||
"object-curly-spacing": [
|
||||
"error",
|
||||
"always"
|
||||
],
|
||||
"multiline-comment-style": "off",
|
||||
"computed-property-spacing": "off",
|
||||
"space-in-parens": "off",
|
||||
"capitalized-comments": "off",
|
||||
"no-lonely-if": "off"
|
||||
},
|
||||
"env": [
|
||||
"es6",
|
||||
"browser",
|
||||
"node",
|
||||
"jquery"
|
||||
]
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "xo",
|
||||
"ignorePatterns": [
|
||||
"phpBB/adm/style/admin.js",
|
||||
"phpBB/adm/style/ajax.js",
|
||||
"phpBB/adm/style/permissions.js",
|
||||
"phpBB/adm/style/tooltip.js",
|
||||
"phpBB/assets/javascript/core.js",
|
||||
"phpBB/assets/javascript/editor.js",
|
||||
"phpBB/assets/javascript/installer.js",
|
||||
"phpBB/assets/javascript/plupload.js",
|
||||
"phpBB/styles/prosilver/template/ajax.js",
|
||||
"phpBB/styles/prosilver/template/forum_fn.js",
|
||||
"phpBB/**/*.min.js",
|
||||
"phpBB/vendor/**/*.js",
|
||||
"phpBB/phpbb/**/*.js",
|
||||
"phpBB/tests/**/*.js"
|
||||
],
|
||||
"rules": {
|
||||
"quotes": [
|
||||
"error",
|
||||
|
@ -130,19 +96,16 @@
|
|||
"devDependencies": {
|
||||
"autoprefixer": "^10.2.5",
|
||||
"cssnano": "^5.0.2",
|
||||
"del": "^6.0.0",
|
||||
"eslint": "^7.27.0",
|
||||
"eslint-config-xo": "^0.36.0",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-concat-css": "^3.1.0",
|
||||
"gulp-postcss": "^9.0.0",
|
||||
"gulp-rename": "^2.0.0",
|
||||
"gulp-sass": "^4.1.0",
|
||||
"gulp-sourcemaps": "^3.0.0",
|
||||
"gulp-sourcemaps": "^2.6.5",
|
||||
"postcss": "^8.2.15",
|
||||
"postcss-import": "^14.0.2",
|
||||
"postcss-pxtorem": "^6.0.0",
|
||||
"postcss-sorting": "^6.0.0",
|
||||
"stylelint": "^13.13.1",
|
||||
"stylelint-order": "^4.1.0",
|
||||
"xo": "^0.40.1",
|
||||
"yargs-parser": "^20.2.7"
|
||||
"stylelint-order": "^4.1.0"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue