Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
101 changes: 0 additions & 101 deletions .eslintrc.json

This file was deleted.

20 changes: 11 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ env:
jobs:
ruby:
name: Check Ruby
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
ruby-version: "3.4"
bundler-cache: true
- name: Lint Ruby files
run: bin/rake lint:rb
Expand All @@ -34,29 +34,31 @@ jobs:

erb:
name: Check ERB
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
ruby-version: "3.4"
bundler-cache: true
- name: Lint ERB files
run: bin/rake lint:erb

javascript:
name: Check JavaScript
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
env:
ESLINT_USE_FLAT_CONFIG: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
ruby-version: "3.4"
bundler-cache: true
- name: Install ESLint globally
run: npm install --save-dev eslint@latest @eslint/js@latest @eslint/eslintrc@latest
- name: Lint JS files
run: bin/rake lint:js
7 changes: 0 additions & 7 deletions admin/.eslintrc.json

This file was deleted.

25 changes: 25 additions & 0 deletions admin/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { defineConfig } from "eslint/config";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";
import rootConfig from "../eslint.config.mjs";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default defineConfig([
{
extends: [compat.extends("eslint:recommended"), rootConfig],

languageOptions: {
ecmaVersion: 2023,
sourceType: "module",
},
}
]);
2 changes: 1 addition & 1 deletion api/spec/requests/spree/api/option_types_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def check_option_values(option_values)
name: "Option Type",
presentation: "Option Type",
option_values_attributes: [
name: "foo", presentation: "Foo"
{ name: "foo", presentation: "Foo" }
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Tabs = (function() {

Tabs.prototype.overflowTabs = function() {
var containerWidth = this.el.offsetWidth;
var dropdownWidth = this.dropdown.offsetWidth;

for (var i = 0; i < this.tabs.length; i++) {
var tab = this.tabs[i];
Expand All @@ -41,7 +40,6 @@ Tabs = (function() {
this.el.classList.remove("tabs-overflowed");
} else {
this.el.classList.add("tabs-overflowed");
remainingWidth -= dropdownWidth;
}

var remainingWidth = containerWidth;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Spree.Views.Tables.SelectableTable.SumReturnItemAmount = Backbone.View.extend({

totalSelectedReturnItemAmount: function () {
var totalAmount = 0;
var selectedItems = [];
var selectedItems;
var decimals = 0;
var separator = Spree.t('currency_separator');
var amount, decimalAmount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ def permitted_attributes

def permitted_credit_card_update_attributes
permitted_attributes.credit_card_update_attributes + [
address_attributes: permitted_address_attributes
{ address_attributes: permitted_address_attributes }
]
end

def permitted_payment_attributes
permitted_attributes.payment_attributes + [
source_attributes: permitted_source_attributes
{ source_attributes: permitted_source_attributes }
]
end

def permitted_source_attributes
permitted_attributes.source_attributes + [
address_attributes: permitted_address_attributes
{ address_attributes: permitted_address_attributes }
]
end

Expand All @@ -52,20 +52,20 @@ def permitted_order_attributes
permitted_checkout_payment_attributes +
permitted_attributes.customer_metadata_attributes +
permitted_checkout_confirm_attributes + [
line_items_attributes: permitted_line_item_attributes
{ line_items_attributes: permitted_line_item_attributes }
]
end

def permitted_product_attributes
permitted_attributes.product_attributes + [
product_properties_attributes: permitted_product_properties_attributes
{ product_properties_attributes: permitted_product_properties_attributes }
]
end

def permitted_user_attributes
permitted_attributes.user_attributes + [
bill_address_attributes: permitted_address_attributes,
ship_address_attributes: permitted_address_attributes
{ bill_address_attributes: permitted_address_attributes,
ship_address_attributes: permitted_address_attributes }
]
end
end
Expand Down
2 changes: 1 addition & 1 deletion core/app/models/spree/user_address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ class UserAddress < Spree::Base
all
}

default_scope -> { order([default: :desc, updated_at: :desc]) }
default_scope -> { order([{ default: :desc, updated_at: :desc }]) }
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@ def up

credit.store_credit_events.chronological.each do |event|
case event.action
when StoreCredit::ALLOCATION_ACTION,
StoreCredit::ELIGIBLE_ACTION,
StoreCredit::CAPTURE_ACTION
# These actions do not change the amount_remaining so the previous
# amount available is used (either the credit's amount or the
# amount_remaining coming from the event right before this one).
credit_amount
when StoreCredit::AUTHORIZE_ACTION,
StoreCredit::INVALIDATE_ACTION
# These actions remove the amount from the available credit amount.
Expand Down
Loading
Loading