From cf690c2c8b3363c82e1b61c1830dca477f474d2a Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Thu, 21 Sep 2023 23:08:44 +0200 Subject: [PATCH] Fix code style --- lib/nested-declaration.js | 2 +- lib/scss-parse.js | 2 +- lib/scss-stringifier.js | 6 +++--- lib/scss-stringify.js | 2 +- lib/scss-syntax.d.ts | 6 +++--- lib/scss-syntax.mjs | 2 +- lib/scss-tokenize.js | 14 +++++++------- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/nested-declaration.js b/lib/nested-declaration.js index 0e202c8..92d296b 100644 --- a/lib/nested-declaration.js +++ b/lib/nested-declaration.js @@ -1,7 +1,7 @@ const { Container } = require('postcss') class NestedDeclaration extends Container { - constructor (defaults) { + constructor(defaults) { super(defaults) this.type = 'decl' this.isNested = true diff --git a/lib/scss-parse.js b/lib/scss-parse.js index 9a7bab6..2116506 100644 --- a/lib/scss-parse.js +++ b/lib/scss-parse.js @@ -2,7 +2,7 @@ let { Input } = require('postcss') let ScssParser = require('./scss-parser') -module.exports = function scssParse (scss, opts) { +module.exports = function scssParse(scss, opts) { let input = new Input(scss, opts) let parser = new ScssParser(input) diff --git a/lib/scss-stringifier.js b/lib/scss-stringifier.js index de54a3a..117e7c5 100644 --- a/lib/scss-stringifier.js +++ b/lib/scss-stringifier.js @@ -1,7 +1,7 @@ let Stringifier = require('postcss/lib/stringifier') class ScssStringifier extends Stringifier { - comment (node) { + comment(node) { let left = this.raw(node, 'left', 'commentLeft') let right = this.raw(node, 'right', 'commentRight') @@ -13,7 +13,7 @@ class ScssStringifier extends Stringifier { } } - decl (node, semicolon) { + decl(node, semicolon) { if (!node.isNested) { super.decl(node, semicolon) } else { @@ -37,7 +37,7 @@ class ScssStringifier extends Stringifier { } } - rawValue (node, prop) { + rawValue(node, prop) { let value = node[prop] let raw = node.raws[prop] if (raw && raw.value === value) { diff --git a/lib/scss-stringify.js b/lib/scss-stringify.js index 7ebf7a1..fc45fdb 100644 --- a/lib/scss-stringify.js +++ b/lib/scss-stringify.js @@ -1,6 +1,6 @@ let ScssStringifier = require('./scss-stringifier') -module.exports = function scssStringify (node, builder) { +module.exports = function scssStringify(node, builder) { let str = new ScssStringifier(builder) str.stringify(node) } diff --git a/lib/scss-syntax.d.ts b/lib/scss-syntax.d.ts index 668ad1a..2f124eb 100644 --- a/lib/scss-syntax.d.ts +++ b/lib/scss-syntax.d.ts @@ -1,4 +1,4 @@ -import * as postcss from 'postcss'; +import * as postcss from 'postcss' -export const parse: postcss.Parser; -export const stringify: postcss.Stringifier; +export const parse: postcss.Parser +export const stringify: postcss.Stringifier diff --git a/lib/scss-syntax.mjs b/lib/scss-syntax.mjs index ace528a..00196ae 100644 --- a/lib/scss-syntax.mjs +++ b/lib/scss-syntax.mjs @@ -1,4 +1,4 @@ -import index from "./scss-syntax.js" +import index from './scss-syntax.js' export default index diff --git a/lib/scss-tokenize.js b/lib/scss-tokenize.js index 7bd7026..02905ba 100644 --- a/lib/scss-tokenize.js +++ b/lib/scss-tokenize.js @@ -33,7 +33,7 @@ const RE_HEX_ESCAPE = /[\da-f]/i const RE_NEW_LINE = /[\n\f\r]/g // SCSS PATCH // SCSS PATCH function name was changed -module.exports = function scssTokenize (input, options = {}) { +module.exports = function scssTokenize(input, options = {}) { let css = input.css.valueOf() let ignore = options.ignoreErrors @@ -47,20 +47,20 @@ module.exports = function scssTokenize (input, options = {}) { let brackets // SCSS PATCH - function position () { + function position() { return pos } - function unclosed (what) { + function unclosed(what) { throw input.error('Unclosed ' + what, pos) } - function endOfFile () { + function endOfFile() { return returned.length === 0 && pos >= length } // SCSS PATCH { - function interpolation () { + function interpolation() { let deep = 1 let stringQuote = false let stringEscaped = false @@ -91,7 +91,7 @@ module.exports = function scssTokenize (input, options = {}) { } // } SCSS PATCH - function nextToken (opts) { + function nextToken(opts) { if (returned.length) return returned.pop() if (pos >= length) return undefined @@ -322,7 +322,7 @@ module.exports = function scssTokenize (input, options = {}) { return currentToken } - function back (token) { + function back(token) { returned.push(token) }