Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Oct 3, 2023
1 parent 9ea946f commit 3ebcf61
Show file tree
Hide file tree
Showing 4 changed files with 620 additions and 338 deletions.
42 changes: 21 additions & 21 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,16 @@ module.exports = (opts = {}) => {
variables[name] = transformBackslashSequences(variables[name])
}
return {
OnceExit (_, { result }) {
Object.keys(variables).forEach(key => {
result.messages.push({
plugin: 'postcss-simple-vars',
type: 'variable',
name: key,
value: variables[key]
})
})
if (opts.onVariables) {
opts.onVariables(variables)
AtRule (node, helpers) {
if (node.name === 'define-mixin') {
mixin(helpers, node)
} else if (node.params && node.params.includes('$')) {
atruleParams(variables, node, opts, helpers.result)
}
},
Comment (node, { result }) {
if (node.text.includes('$')) {
comment(variables, node, opts, result)
}
},
Declaration (node, { result }) {
Expand All @@ -182,16 +181,17 @@ module.exports = (opts = {}) => {
declProp(variables, node, opts, result)
}
},
Comment (node, { result }) {
if (node.text.includes('$')) {
comment(variables, node, opts, result)
}
},
AtRule (node, helpers) {
if (node.name === 'define-mixin') {
mixin(helpers, node)
} else if (node.params && node.params.includes('$')) {
atruleParams(variables, node, opts, helpers.result)
OnceExit (_, { result }) {
Object.keys(variables).forEach(key => {
result.messages.push({
name: key,
plugin: 'postcss-simple-vars',
type: 'variable',
value: variables[key]
})
})
if (opts.onVariables) {
opts.onVariables(variables)
}
},
Rule (node, { result }) {
Expand Down
4 changes: 2 additions & 2 deletions index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,15 @@ test('supports nested vairables', () => {
test('exports variables to messages', () => {
equal(run('$one: 1; $p: on;', '').messages, [
{
name: 'one',
plugin: 'postcss-simple-vars',
type: 'variable',
name: 'one',
value: '1'
},
{
name: 'p',
plugin: 'postcss-simple-vars',
type: 'variable',
name: 'p',
value: 'on'
}
])
Expand Down
18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,18 @@
"postcss": "^8.2.1"
},
"devDependencies": {
"@logux/eslint-config": "^49.0.0",
"c8": "^7.13.0",
"clean-publish": "^4.1.1",
"eslint": "^8.36.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^15.6.1",
"@logux/eslint-config": "^52.0.1",
"c8": "^8.0.1",
"clean-publish": "^4.2.0",
"eslint": "^8.50.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-n": "^16.1.0",
"eslint-plugin-node-imports": "^1.0.2",
"eslint-plugin-perfectionist": "^2.1.0",
"eslint-plugin-prefer-let": "^3.0.1",
"eslint-plugin-promise": "^6.1.1",
"postcss": "^8.4.21",
"postcss": "^8.4.31",
"postcss-each": "^1.1.0",
"postcss-for": "^2.1.1",
"postcss-mixins": "^9.0.4",
Expand Down
Loading

0 comments on commit 3ebcf61

Please sign in to comment.