Switch to using xo directly.

This commit is contained in:
XhmikosR 2020-05-02 18:06:36 +03:00
parent 69afafe811
commit 5085ea054f
9 changed files with 2030 additions and 269 deletions

View file

@ -1,6 +0,0 @@
**/*.min.js
**/dist/
**/vendor/
/_gh_pages/
/js/coverage/
/site/static/sw.js

View file

@ -1,59 +0,0 @@
{
"root": true,
"extends": [
"plugin:import/errors",
"plugin:import/warnings",
"plugin:unicorn/recommended",
"xo/esnext",
"xo/browser"
],
"rules": {
"capitalized-comments": "off",
"indent": [
"error",
2,
{
"MemberExpression": "off",
"SwitchCase": 1
}
],
"max-params": [
"warn",
5
],
"multiline-ternary": [
"error",
"always-multiline"
],
"new-cap": [
"error",
{
"properties": false
}
],
"no-console": "error",
"object-curly-spacing": [
"error",
"always"
],
"prefer-named-capture-group": "off",
"semi": [
"error",
"never"
],
"unicorn/consistent-function-scoping": "off",
"unicorn/explicit-length-check": "off",
"unicorn/import-index": "off",
"unicorn/no-array-callback-reference": "off",
"unicorn/no-for-loop": "off",
"unicorn/no-null": "off",
"unicorn/no-unused-properties": "error",
"unicorn/no-useless-undefined": "off",
"unicorn/prefer-dom-node-append": "off",
"unicorn/prefer-dom-node-dataset": "off",
"unicorn/prefer-dom-node-remove": "off",
"unicorn/prefer-optional-catch-binding": "off",
"unicorn/prefer-query-selector": "off",
"unicorn/prevent-abbreviations": "off"
}
}

View file

@ -1,14 +0,0 @@
{
"env": {
"browser": false,
"node": true
},
"parserOptions": {
"sourceType": "script"
},
"extends": "../.eslintrc.json",
"rules": {
"no-console": "off",
"strict": "error"
}
}

View file

@ -17,6 +17,7 @@ import Tab from './src/tab'
import Toast from './src/toast'
import Tooltip from './src/tooltip'
// eslint-disable-next-line import/no-anonymous-default-export
export default {
Alert,
Button,

View file

@ -1,5 +1,5 @@
import Tooltip from '../../dist/tooltip'
import '../../dist/carousel'
import '../../dist/carousel' // eslint-disable-line import/no-unassigned-import
window.addEventListener('load', () => {
[].concat(...document.querySelectorAll('[data-bs-toggle="tooltip"]'))

View file

@ -1,16 +0,0 @@
{
"root": true,
"extends": [
"../../../.eslintrc.json"
],
"overrides": [
{
"files": [
"**/*.spec.js"
],
"env": {
"jasmine": true
}
}
]
}

2065
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -41,7 +41,7 @@
"js-compile-standalone-esm": "rollup --environment ESM:true,BUNDLE:false --config build/rollup.config.js --sourcemap",
"js-compile-bundle": "rollup --environment BUNDLE:true --config build/rollup.config.js --sourcemap",
"js-compile-plugins": "node build/build-plugins.js",
"js-lint": "eslint --cache --cache-location .cache/.eslintcache --report-unused-disable-directives .",
"js-lint": "xo",
"js-minify": "npm-run-all --parallel js-minify-*",
"js-minify-standalone": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/bootstrap.js.map,includeSources,url=bootstrap.min.js.map\" --output dist/js/bootstrap.min.js dist/js/bootstrap.js",
"js-minify-standalone-esm": "terser --compress passes=2 --mangle --comments \"/^!/\" --source-map \"content=dist/js/bootstrap.esm.js.map,includeSources,url=bootstrap.esm.min.js.map\" --output dist/js/bootstrap.esm.min.js dist/js/bootstrap.esm.js",
@ -112,10 +112,6 @@
"bundlewatch": "^0.3.1",
"clean-css-cli": "^4.3.0",
"cross-env": "^7.0.3",
"eslint": "^7.17.0",
"eslint-config-xo": "^0.34.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-unicorn": "^25.0.1",
"find-unused-sass-variables": "^3.1.0",
"glob": "^7.1.6",
"hammer-simulator": "0.0.1",
@ -145,7 +141,8 @@
"stylelint": "^13.8.0",
"stylelint-config-twbs-bootstrap": "^2.1.0",
"terser": "5.1.0",
"vnu-jar": "20.6.30"
"vnu-jar": "20.6.30",
"xo": "^0.37.1"
},
"files": [
"dist/{css,js}/*.{css,js,map}",
@ -172,5 +169,89 @@
"peerDependencies": {
"@popperjs/core": "^2.6.0"
}
},
"xo": {
"envs": [
"browser"
],
"esnext": true,
"semicolon": false,
"space": 2,
"ignores": [
"**/*.min.js",
"**/dist/**",
"**/vendor/**",
"site/static/sw.js"
],
"rules": {
"capitalized-comments": "off",
"import/no-mutable-exports": "off",
"import/no-useless-path-segments": "off",
"max-params": [
"warn",
5
],
"new-cap": [
"error",
{
"properties": false
}
],
"no-console": "error",
"object-curly-spacing": [
"error",
"always"
],
"unicorn/consistent-function-scoping": "off",
"unicorn/explicit-length-check": "off",
"unicorn/import-index": "off",
"unicorn/no-array-callback-reference": "off",
"unicorn/no-for-loop": "off",
"unicorn/no-null": "off",
"unicorn/no-unused-properties": "error",
"unicorn/prefer-array-find": "off",
"unicorn/prefer-dom-node-append": "off",
"unicorn/prefer-dom-node-dataset": "off",
"unicorn/prefer-dom-node-remove": "off",
"unicorn/prefer-optional-catch-binding": "off",
"unicorn/prefer-query-selector": "off",
"unicorn/prevent-abbreviations": "off"
},
"overrides": [
{
"files": "build/*.js",
"envs": [
"node"
],
"parserOptions": {
"sourceType": "script"
},
"rules": {
"no-console": "off",
"strict": "error"
}
},
{
"files": "js/tests/unit/**/*.spec.js",
"envs": [
"jasmine"
]
},
{
"files": "site/**/*.js",
"esnext": false,
"parserOptions": {
"ecmaVersion": 5,
"sourceType": "script"
},
"rules": {
"no-new": "off",
"strict": [
"error",
"function"
]
}
}
]
}
}

View file

@ -1,43 +0,0 @@
{
"root": true,
"parserOptions": {
"ecmaVersion": 5,
"sourceType": "script"
},
"extends": [
"plugin:unicorn/recommended",
"xo",
"xo/browser"
],
"rules": {
"capitalized-comments": "off",
"indent": [
"error",
2,
{
"MemberExpression": "off",
"SwitchCase": 1
}
],
"multiline-ternary": [
"error",
"always-multiline"
],
"no-new": "off",
"object-curly-spacing": [
"error",
"always"
],
"semi": [
"error",
"never"
],
"strict": "error",
"unicorn/no-for-loop": "off",
"unicorn/no-null": "off",
"unicorn/prefer-dom-node-append": "off",
"unicorn/prefer-dom-node-dataset": "off",
"unicorn/prefer-query-selector": "off",
"unicorn/prevent-abbreviations": "off"
}
}