mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-23 15:16:50 +00:00
build: Fix gaps in lint coverage and update old patterns
eslint:
* Remove hardcoded glob paths that are (relatively slow) to expand
before linting could start, in favour of specifying directories
which can be iterated while linting happens.
* JSON files in i18n/ were skipped, unlike other repos.
JS code under .storybook/ was skipped.
JS code under resources/ext.popups/ was skipped.
Fix all these by doing what other repos do, which is to let
ESLint iterate the repository and tell it which directories not to
enter. This has the happy side-effect of making IDE integrations
for ESLint work correctly (as customisation in package.json has the
same problems as using Gruntfile, namely that invoking 'eslint'
directly can't be aware of this), as well as allowing things like
`eslint --fix` to be used.
```
/Popups/resources/ext.popups/index.js
4:2 error Unexpected var, use let or const instead no-var
```
nyc:
* Remove SPAWN_WRAP_SHIM_ROOT.
This was a hack for an early CI experiment that hasn't been
needed for several years.
storybook:
* Remove gitignore entries for additional npm and build output in the
storybook subdirectory, which appears to not exist anymore since
189b386a13
.
Doxygen:
* Sync with cookiecutter example from
https://gerrit.wikimedia.org/g/mediawiki/tools/cookiecutter-library/+/HEAD/
- remove redundant stuff,
- enable quiet mode to hide verbose non-warning,
- include CoC.
Change-Id: If8f6b833067192aea96a87f04c7978c9af11f996
This commit is contained in:
parent
48df0cbaea
commit
06ab2d7676
5
.eslintignore
Normal file
5
.eslintignore
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# coverage
|
||||||
|
/.nyc_output/
|
||||||
|
# docs and storybook
|
||||||
|
/docs/
|
||||||
|
/vendor/
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -6,8 +6,6 @@
|
||||||
/vendor/
|
/vendor/
|
||||||
/composer.lock
|
/composer.lock
|
||||||
/.eslintcache
|
/.eslintcache
|
||||||
/.storybook/node_modules
|
|
||||||
/.storybook/dist
|
|
||||||
/.storybook/mocks/**/*.less
|
/.storybook/mocks/**/*.less
|
||||||
/tests/selenium/log
|
/tests/selenium/log
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
17
Doxyfile
17
Doxyfile
|
@ -1,3 +1,5 @@
|
||||||
|
# Doxyfile <https://www.doxygen.nl/manual/config.html>
|
||||||
|
|
||||||
PROJECT_NAME = Popups
|
PROJECT_NAME = Popups
|
||||||
PROJECT_BRIEF = "Displays page/reference previews when hovering over a link to an article/reference."
|
PROJECT_BRIEF = "Displays page/reference previews when hovering over a link to an article/reference."
|
||||||
|
|
||||||
|
@ -9,8 +11,9 @@ JAVADOC_AUTOBRIEF = YES
|
||||||
QT_AUTOBRIEF = YES
|
QT_AUTOBRIEF = YES
|
||||||
|
|
||||||
WARN_NO_PARAMDOC = YES
|
WARN_NO_PARAMDOC = YES
|
||||||
|
QUIET = YES
|
||||||
|
|
||||||
INPUT = .
|
INPUT = README.md CODE_OF_CONDUCT.md .
|
||||||
EXCLUDE_PATTERNS = doc docs vendor node_modules tests
|
EXCLUDE_PATTERNS = doc docs vendor node_modules tests
|
||||||
FILE_PATTERNS = *.php
|
FILE_PATTERNS = *.php
|
||||||
|
|
||||||
|
@ -18,19 +21,9 @@ FILE_PATTERNS = *.php
|
||||||
RECURSIVE = YES
|
RECURSIVE = YES
|
||||||
|
|
||||||
# NOTE: USE_MDFILE_AS_MAINPAGE requires that the specified file is included as an input file.
|
# NOTE: USE_MDFILE_AS_MAINPAGE requires that the specified file is included as an input file.
|
||||||
USE_MDFILE_AS_MAINPAGE = ./README.md
|
USE_MDFILE_AS_MAINPAGE = README.md
|
||||||
INPUT += ./README.md
|
|
||||||
|
|
||||||
HTML_DYNAMIC_SECTIONS = YES
|
HTML_DYNAMIC_SECTIONS = YES
|
||||||
GENERATE_TREEVIEW = YES
|
GENERATE_TREEVIEW = YES
|
||||||
TREEVIEW_WIDTH = 250
|
TREEVIEW_WIDTH = 250
|
||||||
|
|
||||||
GENERATE_LATEX = NO
|
GENERATE_LATEX = NO
|
||||||
|
|
||||||
HAVE_DOT = YES
|
|
||||||
DOT_FONTNAME = Helvetica
|
|
||||||
DOT_FONTSIZE = 12
|
|
||||||
TEMPLATE_RELATIONS = YES
|
|
||||||
|
|
||||||
# Makes dot run faster. Requires graphviz >1.8.10
|
|
||||||
DOT_MULTI_TARGETS = YES
|
|
||||||
|
|
|
@ -12,9 +12,9 @@
|
||||||
"test:lint:styles": "npm -s run linter:styles",
|
"test:lint:styles": "npm -s run linter:styles",
|
||||||
"test:lint:i18n": "banana-checker --requireLowerCase=0 i18n/",
|
"test:lint:i18n": "banana-checker --requireLowerCase=0 i18n/",
|
||||||
"check-built-assets": "echo 'CHECKING BUILD SOURCES ARE COMMITTED OR STAGED' && npm -s run build && git diff --exit-code resources/dist || { npm run node-debug; false; }",
|
"check-built-assets": "echo 'CHECKING BUILD SOURCES ARE COMMITTED OR STAGED' && npm -s run build && git diff --exit-code resources/dist || { npm run node-debug; false; }",
|
||||||
"coverage": "SPAWN_WRAP_SHIM_ROOT=\"$PWD/.nyc_output\" nyc npm -s run test:unit",
|
"coverage": "nyc npm -s run test:unit",
|
||||||
"doc": "jsdoc -c jsdoc.json && npm run build-storybook",
|
"doc": "jsdoc -c jsdoc.json && npm run build-storybook",
|
||||||
"linter:js": "eslint --cache '*.{js,json}' 'src/**/*.{js,json}' 'tests/**/*.{js,json}' 'resources/dist/*.js'",
|
"linter:js": "eslint --cache .",
|
||||||
"linter:styles": "stylelint 'src/**/*.less'",
|
"linter:styles": "stylelint 'src/**/*.less'",
|
||||||
"minify-svg": "svgo --config=.svgo.config.js -q -r -f resources/ext.popups.images/",
|
"minify-svg": "svgo --config=.svgo.config.js -q -r -f resources/ext.popups.images/",
|
||||||
"node-debug": "node -v && npm -v && echo 'Please ensure you are running the correct version of nvm before running this command.'",
|
"node-debug": "node -v && npm -v && echo 'Please ensure you are running the correct version of nvm before running this command.'",
|
||||||
|
|
4
resources/.eslintrc.json
Normal file
4
resources/.eslintrc.json
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"root": true,
|
||||||
|
"extends": "wikimedia/language/es5"
|
||||||
|
}
|
2
resources/dist/.eslintrc.json
vendored
2
resources/dist/.eslintrc.json
vendored
|
@ -1,6 +1,4 @@
|
||||||
{
|
{
|
||||||
"root": true,
|
|
||||||
"extends": "wikimedia/language/es5",
|
|
||||||
"rules": {
|
"rules": {
|
||||||
"es/no-object-getownpropertysymbols": "off"
|
"es/no-object-getownpropertysymbols": "off"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue