mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
chore: upgrade eslint config
This commit is contained in:
parent
74e0f34a0a
commit
638202d643
@ -1,6 +1,6 @@
|
||||
*actual*
|
||||
*expected*
|
||||
.vscode
|
||||
.nyc_output
|
||||
node_modules
|
||||
coverage
|
||||
dist
|
||||
__snapshots__
|
||||
|
||||
@ -2,20 +2,14 @@
|
||||
"root": true,
|
||||
"extends": ["eslint:recommended", "prettier"],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018,
|
||||
"sourceType": "module",
|
||||
"ecmaFeatures": {
|
||||
"jsx": false
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
"no-console": "off"
|
||||
"impliedStrict": true
|
||||
},
|
||||
"env": {
|
||||
"browser": true,
|
||||
"node": true,
|
||||
"es6": true,
|
||||
"mocha": true
|
||||
"mocha": true,
|
||||
"es2020": true,
|
||||
"browser": true
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
@ -27,13 +21,12 @@
|
||||
"prettier"
|
||||
],
|
||||
"rules": {
|
||||
"no-prototype-builtins": "off",
|
||||
"no-constant-condition": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||||
"@typescript-eslint/no-non-null-assertion": "off",
|
||||
"@typescript-eslint/no-empty-function": "off",
|
||||
"@typescript-eslint/no-var-requires": "off"
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-var-requires": "off",
|
||||
"@typescript-eslint/no-namespace": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
128
.gitignore
vendored
128
.gitignore
vendored
@ -1,117 +1,19 @@
|
||||
### Project ###
|
||||
*.marko.js
|
||||
*actual*
|
||||
# Editor
|
||||
*.sublime*
|
||||
.vscode
|
||||
|
||||
# OSX
|
||||
*.DS_Store
|
||||
|
||||
# NPM
|
||||
node_modules
|
||||
npm-debug.log
|
||||
|
||||
# Build
|
||||
dist
|
||||
*.actual.*
|
||||
*.tsbuildinfo
|
||||
|
||||
### Node ###
|
||||
# Logs
|
||||
logs
|
||||
*.log*
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# nyc test coverage
|
||||
# Coverage
|
||||
.nyc_output
|
||||
|
||||
# Dependency directories
|
||||
node_modules
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn
|
||||
.yarn-integrity
|
||||
|
||||
# Npm
|
||||
package-lock.json
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
.env.test
|
||||
|
||||
### Git ###
|
||||
# Created by git for backups. To disable backups in Git:
|
||||
# $ git config --global mergetool.keepBackup false
|
||||
*.orig
|
||||
|
||||
# Created by git when using merge tools for conflicts
|
||||
*.BACKUP.*
|
||||
*.BASE.*
|
||||
*.LOCAL.*
|
||||
*.REMOTE.*
|
||||
*_BACKUP_*.txt
|
||||
*_BASE_*.txt
|
||||
*_LOCAL_*.txt
|
||||
*_REMOTE_*.txt
|
||||
|
||||
### OS ###
|
||||
|
||||
# Linux
|
||||
*~
|
||||
.fuse_hidden*
|
||||
.directory
|
||||
.Trash-*
|
||||
.nfs*
|
||||
|
||||
# Mac
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
._*
|
||||
Icon
|
||||
|
||||
# Windows
|
||||
*[Tt]humbs*.db*
|
||||
[Dd]esktop.ini
|
||||
*.stackdump
|
||||
*.lnk
|
||||
|
||||
### EDITOR ###
|
||||
|
||||
# VisualStudioCode
|
||||
.vscode
|
||||
.history
|
||||
|
||||
# JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
modules.xml
|
||||
.idea
|
||||
|
||||
# SublimeText
|
||||
*.cache
|
||||
*.sublime-*
|
||||
Package Control.*
|
||||
oscrypto-ca-bundle.crt
|
||||
|
||||
# TextMate
|
||||
*.tmproj
|
||||
*.tmproject
|
||||
tmtags
|
||||
|
||||
# Vim
|
||||
*.swp
|
||||
*.vim
|
||||
.netrwhist
|
||||
coverage
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
{
|
||||
"*.{json,md}": ["prettier --write"],
|
||||
"*.{js,ts}": ["eslint --fix", "prettier --write"],
|
||||
"./{,packages/*/}package.json": ["fixpack"]
|
||||
}
|
||||
5
.lintstagedrc.json
Normal file
5
.lintstagedrc.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"*.ts": ["eslint --fix", "prettier --write"],
|
||||
"*{.js,.json,.md,.yml,rc}": ["prettier --write"],
|
||||
"./{,packages/*/}package.json": ["fixpack"]
|
||||
}
|
||||
@ -69,6 +69,7 @@ export function init(runtimeId = "M" /* [a-zA-Z0-9]+ */) {
|
||||
const token = nodeValue[runtimeLength];
|
||||
const data = nodeValue.slice(runtimeLength + 1);
|
||||
if (token === HydrateSymbols.SCOPE_OFFSET) {
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
if ("MARKO_DEBUG") {
|
||||
const [offset, scopeId, index] = data.split(" ");
|
||||
if (scopeId !== currentScope[ScopeOffsets.ID]) {
|
||||
@ -93,6 +94,7 @@ export function init(runtimeId = "M" /* [a-zA-Z0-9]+ */) {
|
||||
}
|
||||
currentScope[ScopeOffsets.START_NODE] = currentNode;
|
||||
} else if (token === HydrateSymbols.SCOPE_END) {
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
if ("MARKO_DEBUG") {
|
||||
if (data !== currentScope[ScopeOffsets.ID]) {
|
||||
throw new Error("SCOPE_END_MISMATCH: " + nodeValue);
|
||||
@ -101,6 +103,7 @@ export function init(runtimeId = "M" /* [a-zA-Z0-9]+ */) {
|
||||
currentScope[ScopeOffsets.END_NODE] = currentNode;
|
||||
currentOffset = stack.pop() as number;
|
||||
currentScope = scopeLookup.get(stack.pop() as string)!;
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
} else if ("MARKO_DEBUG") {
|
||||
throw new Error("MALFORMED MARKER: " + nodeValue);
|
||||
}
|
||||
|
||||
@ -64,6 +64,7 @@ export function dynamicTag(
|
||||
: { renderBody, ...input }
|
||||
: input
|
||||
);
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
} else if ("MARKO_DEBUG") {
|
||||
throw new Error(`Invalid renderer passed for dynamic tag: ${tag}`);
|
||||
}
|
||||
|
||||
@ -247,6 +247,7 @@ const lastIndex = new WeakMap();
|
||||
export function markScopeOffset(index: number, scope: Scope) {
|
||||
const offset = index - (lastIndex.get(scope) || 0);
|
||||
lastIndex.set(scope, index);
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
if ("MARKO_DEBUG") {
|
||||
return `<!${runtimeId}${HydrateSymbols.SCOPE_OFFSET}${offset} ${
|
||||
scope[ScopeOffsets.ID]
|
||||
@ -262,6 +263,7 @@ export function markScopeStart(scope: Scope) {
|
||||
}
|
||||
|
||||
export function markScopeEnd(scope: Scope) {
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
if ("MARKO_DEBUG") {
|
||||
return `<!${runtimeId}${HydrateSymbols.SCOPE_END}${
|
||||
scope[ScopeOffsets.ID]
|
||||
|
||||
@ -323,6 +323,7 @@ function trackInputReference(
|
||||
let curPath = identifier as t.NodePath<t.Node>;
|
||||
let curAccessor = accessor;
|
||||
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
while (true) {
|
||||
const parentPath = curPath.parentPath!;
|
||||
|
||||
|
||||
@ -47,6 +47,7 @@ function getRuntime<T extends t.Node>(
|
||||
function getRuntimePath<T extends t.Node>(path: t.NodePath<T>, output: string) {
|
||||
const { optimize } = getMarkoOpts(path);
|
||||
return `@marko/runtime-fluurt/${
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
"MARKO_SRC" ? "src" : optimize ? "dist" : "dist/debug"
|
||||
}/${output}`;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user