Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Sep 21, 2023
1 parent 8bdfc73 commit cf690c2
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/nested-declaration.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { Container } = require('postcss')

class NestedDeclaration extends Container {
constructor (defaults) {
constructor(defaults) {
super(defaults)
this.type = 'decl'
this.isNested = true
Expand Down
2 changes: 1 addition & 1 deletion lib/scss-parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions lib/scss-stringifier.js
Original file line number Diff line number Diff line change
@@ -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')

Expand All @@ -13,7 +13,7 @@ class ScssStringifier extends Stringifier {
}
}

decl (node, semicolon) {
decl(node, semicolon) {
if (!node.isNested) {
super.decl(node, semicolon)
} else {
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion lib/scss-stringify.js
Original file line number Diff line number Diff line change
@@ -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)
}
6 changes: 3 additions & 3 deletions lib/scss-syntax.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as postcss from 'postcss';
import * as postcss from 'postcss'

export const parse: postcss.Parser<postcss.Root>;
export const stringify: postcss.Stringifier;
export const parse: postcss.Parser<postcss.Root>
export const stringify: postcss.Stringifier
2 changes: 1 addition & 1 deletion lib/scss-syntax.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import index from "./scss-syntax.js"
import index from './scss-syntax.js'

export default index

Expand Down
14 changes: 7 additions & 7 deletions lib/scss-tokenize.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -322,7 +322,7 @@ module.exports = function scssTokenize (input, options = {}) {
return currentToken
}

function back (token) {
function back(token) {
returned.push(token)
}

Expand Down

0 comments on commit cf690c2

Please sign in to comment.