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: |
|
run: |
|
||||||
.github/check-stylesheet.sh
|
.github/check-stylesheet.sh
|
||||||
|
|
||||||
|
- name: Lint JavaScript files
|
||||||
|
run: |
|
||||||
|
.github/check-js.sh
|
||||||
|
|
||||||
- name: Check commit message
|
- name: Check commit message
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
run: |
|
run: |
|
||||||
|
|
68
gulpfile.js
68
gulpfile.js
|
@ -1,47 +1,57 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const del = require('del');
|
|
||||||
const gulp = require('gulp');
|
const gulp = require('gulp');
|
||||||
const autoprefixer = require('autoprefixer');
|
|
||||||
// const sass = require('gulp-sass');
|
|
||||||
const rename = require('gulp-rename');
|
const rename = require('gulp-rename');
|
||||||
const sourcemaps = require('gulp-sourcemaps');
|
const sourcemaps = require('gulp-sourcemaps');
|
||||||
const cssnano = require('cssnano');
|
const concat = require('gulp-concat-css');
|
||||||
const postcss = require('gulp-postcss');
|
const postcss = require('gulp-postcss');
|
||||||
|
const autoprefixer = require('autoprefixer');
|
||||||
|
const cssnano = require('cssnano');
|
||||||
const sorting = require('postcss-sorting');
|
const sorting = require('postcss-sorting');
|
||||||
const atimport = require('postcss-import');
|
|
||||||
// const torem = require('postcss-pxtorem');
|
|
||||||
const sortOrder = require('./.postcss-sorting.json');
|
const sortOrder = require('./.postcss-sorting.json');
|
||||||
// const pkg = require('./package.json');
|
|
||||||
|
|
||||||
// Config
|
// Config
|
||||||
const build = {
|
const paths = {
|
||||||
|
styles: {
|
||||||
|
src: './phpBB/styles/prosilver/theme/*.css',
|
||||||
css: './phpBB/styles/prosilver/theme/',
|
css: './phpBB/styles/prosilver/theme/',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
gulp.task('css', gulp.series(() => {
|
function styles() {
|
||||||
return gulp
|
return gulp.src(paths.styles.src)
|
||||||
.src(build.css + '*.css')
|
.pipe(sourcemaps.init())
|
||||||
.pipe(
|
.pipe(
|
||||||
postcss([
|
postcss([
|
||||||
autoprefixer(),
|
autoprefixer(),
|
||||||
sorting(sortOrder),
|
sorting(sortOrder),
|
||||||
]),
|
]),
|
||||||
)
|
)
|
||||||
.pipe(gulp.dest(build.css));
|
.pipe(sourcemaps.write('./'))
|
||||||
}));
|
.pipe(gulp.dest(paths.styles.css));
|
||||||
|
}
|
||||||
|
|
||||||
gulp.task('clean', gulp.series(() => {
|
function minify() {
|
||||||
del([ 'dist' ]);
|
return gulp.src([
|
||||||
}));
|
paths.styles.css + 'normalize.css',
|
||||||
|
paths.styles.css + 'base.css',
|
||||||
gulp.task('minify', gulp.series(() => {
|
paths.styles.css + 'utilities.css',
|
||||||
return gulp
|
paths.styles.css + 'icons.css',
|
||||||
.src(build.css + '/bidi.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(sourcemaps.init())
|
||||||
|
.pipe(concat('stylesheet.css'))
|
||||||
.pipe(
|
.pipe(
|
||||||
postcss([
|
postcss([
|
||||||
atimport(),
|
|
||||||
cssnano(),
|
cssnano(),
|
||||||
]),
|
]),
|
||||||
)
|
)
|
||||||
|
@ -50,11 +60,15 @@ gulp.task('minify', gulp.series(() => {
|
||||||
extname: '.css',
|
extname: '.css',
|
||||||
}))
|
}))
|
||||||
.pipe(sourcemaps.write('./'))
|
.pipe(sourcemaps.write('./'))
|
||||||
.pipe(gulp.dest(build.css));
|
.pipe(gulp.dest(paths.styles.css));
|
||||||
}));
|
}
|
||||||
|
|
||||||
gulp.task('watch', gulp.series(() => {
|
function watch() {
|
||||||
gulp.watch('phpBB/styles/prosilver/theme/*.css', gulp.series('css'));
|
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": {
|
"directories": {
|
||||||
"doc": "docs"
|
"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": {
|
"eslintConfig": {
|
||||||
"extends": "xo",
|
"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": {
|
"rules": {
|
||||||
"quotes": [
|
"quotes": [
|
||||||
"error",
|
"error",
|
||||||
|
@ -130,19 +96,16 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"autoprefixer": "^10.2.5",
|
"autoprefixer": "^10.2.5",
|
||||||
"cssnano": "^5.0.2",
|
"cssnano": "^5.0.2",
|
||||||
"del": "^6.0.0",
|
"eslint": "^7.27.0",
|
||||||
|
"eslint-config-xo": "^0.36.0",
|
||||||
"gulp": "^4.0.2",
|
"gulp": "^4.0.2",
|
||||||
|
"gulp-concat-css": "^3.1.0",
|
||||||
"gulp-postcss": "^9.0.0",
|
"gulp-postcss": "^9.0.0",
|
||||||
"gulp-rename": "^2.0.0",
|
"gulp-rename": "^2.0.0",
|
||||||
"gulp-sass": "^4.1.0",
|
"gulp-sourcemaps": "^2.6.5",
|
||||||
"gulp-sourcemaps": "^3.0.0",
|
|
||||||
"postcss": "^8.2.15",
|
"postcss": "^8.2.15",
|
||||||
"postcss-import": "^14.0.2",
|
|
||||||
"postcss-pxtorem": "^6.0.0",
|
|
||||||
"postcss-sorting": "^6.0.0",
|
"postcss-sorting": "^6.0.0",
|
||||||
"stylelint": "^13.13.1",
|
"stylelint": "^13.13.1",
|
||||||
"stylelint-order": "^4.1.0",
|
"stylelint-order": "^4.1.0"
|
||||||
"xo": "^0.40.1",
|
|
||||||
"yargs-parser": "^20.2.7"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue