Skip to content

Refactor, change where validation occurs #1721

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Sep 15, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
all but two tests passing
  • Loading branch information
Rich-Harris committed Sep 15, 2018
commit d5c45cbac9a91ad6a95993d6d43aedcd0a4ebe27
2 changes: 1 addition & 1 deletion src/compile/Component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ function getIndentationLevel(str: string, b: number) {
}

function getIndentExclusionRanges(node: Node) {
// TODO can we fold this into a different pass?
const ranges: Node[] = [];
walk(node, {
enter(node: Node) {
Expand Down Expand Up @@ -868,7 +869,6 @@ export default class Component {
if (js) {
this.addSourcemapLocations(js.content);

const indentation = detectIndentation(source.slice(js.start, js.end));
const indentationLevel = getIndentationLevel(source, js.content.body[0].start);
const indentExclusionRanges = getIndentExclusionRanges(js.content);

Expand Down
30 changes: 0 additions & 30 deletions src/validate/html/index.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/validate/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import validateJs from './js/index';
import validateHtml from './html/index';
import { getLocator, Location } from 'locate-character';
import getCodeFrame from '../utils/getCodeFrame';
import Stats from '../Stats';
Expand Down Expand Up @@ -135,10 +134,6 @@ export default function validate(
stylesheet.validate(validator);
}

if (ast.html) {
validateHtml(validator, ast.html);
}

// need to do a second pass of the JS, now that we've analysed the markup
if (ast.js && validator.defaultExport) {
const categories = {
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy