Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: XhmikosR/find-unused-sass-variables
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.0
Choose a base ref
...
head repository: XhmikosR/find-unused-sass-variables
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.0.0
Choose a head ref
Loading
Showing with 1,602 additions and 1,359 deletions.
  1. +11 −0 .github/dependabot.yml
  2. +25 −0 .github/workflows/codeql.yml
  3. +1 −4 .github/workflows/test.yml
  4. +3 −3 lib/parse-variable.js
  5. +1,555 −1,346 package-lock.json
  6. +7 −6 package.json
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: weekly
day: tuesday
time: "12:00"
timezone: Europe/Athens
open-pull-requests-limit: 10
versioning-strategy: increase
25 changes: 25 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Code Scanning - Action"

on:
push:
schedule:
- cron: "0 0 * * 0"

jobs:
CodeQL-Build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: javascript

- name: Autobuild
uses: github/codeql-action/autobuild@v1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
5 changes: 1 addition & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [10, 12]
node: [10, 12, 14]

steps:
- name: Clone repository
@@ -22,9 +22,6 @@ jobs:
with:
node-version: ${{ matrix.node }}

- run: node --version
- run: npm --version

- name: Install npm dependencies
run: npm ci

6 changes: 3 additions & 3 deletions lib/parse-variable.js
Original file line number Diff line number Diff line change
@@ -6,8 +6,8 @@ const Comment = require('postcss/lib/comment');
let fusvEnabled = true;

function parseNodes(nodes, variables, ignoreList) {
for (let i = 0, len = nodes.length; i < len; i++) {
findVars(nodes[i], variables, ignoreList);
for (const node of nodes) {
findVars(node, variables, ignoreList);
}
}

@@ -18,7 +18,7 @@ function findVars(node, result, ignoreList) {
return;
}

if (node instanceof Declaration && node.prop.charAt(0) === '$' && !ignoreList.includes(node.prop) && fusvEnabled) {
if (node instanceof Declaration && node.prop.startsWith('$') && !ignoreList.includes(node.prop) && fusvEnabled) {
result.push(node.prop);

return;
Loading