docsify/.eslintrc.js
Roy Sommer 8cbc7c8073
Virtual Routes Support (#1799)
* add first test

* new VirtualRoutes mixin that handles routes. fetch tries to use VirtualRoutes. default config updated

* cover all basic use cases

* regex matching in routes

* covered all virtual routes tests

* added hack to fix config test on firefox

* removed formatting regex matches into string routes

* added support for "next" function

* added docs

* navigate now supports both hash and history routerModes

* waiting for networkidle in navigateToRoute helper

* promiseless implementation

* remove firefox workaround from catchPluginErrors test, since we no longer use promises

* updated docs

* updated docs for "alias" as well

* minor rephrasing

* removed non-legacy code from exact-match; updated navigateToRoute helper to infer router mode from page

* moved endsWith from router utils to general utils; added startsWith util; refactored makeExactMatcher to use both

* updated docs per feedback

* moved navigateToRoute helper into the virtual-routes test file

* moved navigateToRoute to top of file

* updated docs per pr comments
2022-05-23 14:03:33 -07:00

85 lines
2.0 KiB
JavaScript

const prettierConfig = require('./.prettierrc');
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:import/recommended',
'plugin:prettier/recommended', // Must be last
],
parser: '@babel/eslint-parser',
parserOptions: {
sourceType: 'module',
ecmaVersion: 2019,
},
plugins: ['prettier', 'import'],
env: {
browser: true,
es6: true,
node: true,
},
settings: {
'import/ignore': ['node_modules', '.json$'],
},
rules: {
camelcase: ['warn'],
curly: ['error', 'all'],
'dot-notation': ['error'],
eqeqeq: ['error'],
'handle-callback-err': ['error'],
'new-cap': ['error'],
'no-alert': ['error'],
'no-caller': ['error'],
'no-eval': ['error'],
'no-labels': ['error'],
'no-lonely-if': ['error'],
'no-new': ['error'],
'no-proto': ['error'],
'no-return-assign': ['error'],
'no-self-compare': ['error'],
'no-shadow-restricted-names': ['error'],
'no-shadow': [
'error',
{
allow: [
'Events',
'Fetch',
'Lifecycle',
'Render',
'Router',
'VirtualRoutes',
],
},
],
'no-unused-vars': ['error', { args: 'none' }],
'no-useless-call': ['error'],
'no-useless-escape': ['warn'],
'no-var': ['error'],
'no-void': ['error'],
'no-with': ['error'],
radix: ['error'],
'spaced-comment': ['error', 'always'],
strict: ['error', 'global'],
yoda: ['error', 'never'],
// Import rules
// Search way how integrate with `lerna`
'import/imports-first': ['error'],
'import/newline-after-import': ['error'],
'import/no-duplicates': ['error'],
'import/no-mutable-exports': ['error'],
'import/no-named-as-default-member': ['error'],
'import/no-named-as-default': ['error'],
'import/no-unresolved': 'off',
'import/order': ['warn'],
// Prettier (Must be last)
'prettier/prettier': ['warn', prettierConfig],
},
globals: {
$docsify: 'writable',
Docsify: 'writable',
dom: 'writable',
},
};