Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use pnpm & renovate, update lint packages #319

Merged
merged 8 commits into from
Nov 1, 2024
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
10 changes: 5 additions & 5 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ engines:
enabled: true
config:
languages:
- javascript
- javascript
eslint:
enabled: true
fixme:
enabled: true
ratings:
paths:
- "**.js"
- "**.js"
exclude_paths:
- config/
- tests/
- vendor/
- config/
- tests/
- vendor/
38 changes: 13 additions & 25 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,15 @@ module.exports = {
ecmaVersion: 2018,
sourceType: 'module',
babelOptions: {
plugins: [
[
require.resolve('@babel/plugin-proposal-decorators'),
{ legacy: true },
],
],
plugins: [[require.resolve('@babel/plugin-proposal-decorators'), { legacy: true }]],
},
requireConfigFile: false,
},
plugins: [
'ember',
'qunit',
'simple-import-sort',
'import',
'unused-imports',
'unicorn',
'no-useless-assign',
],
plugins: ['ember', 'qunit', 'simple-import-sort', 'import', 'unused-imports', 'unicorn', 'no-useless-assign'],
extends: [
'eslint:recommended',
'prettier/prettier',
'plugin:ember/recommended',
'plugin:prettier/recommended',
'plugin:qunit/recommended',
'plugin:unicorn/recommended',
],
Expand Down Expand Up @@ -102,10 +89,7 @@ module.exports = {
],
*/
complexity: ['error', { max: 20 }],
'no-magic-numbers': [
'error',
{ ignore: [0, 1, -1], ignoreArrayIndexes: true },
],
'no-magic-numbers': ['error', { ignore: [0, 1, -1], ignoreArrayIndexes: true }],

'object-shorthand': ['error', 'always'],
'no-restricted-imports': [
Expand Down Expand Up @@ -158,7 +142,7 @@ module.exports = {
'ember/no-deeply-nested-dependent-keys-with-each': 'error',
'ember/jquery-ember-run': 'error',
'qunit/no-assert-equal-boolean': 'error',
'qunit/require-expect': 'error',
'qunit/require-expect': 'off',
'qunit/no-compare-relation-boolean': 'error',
'no-restricted-globals': [
'error',
Expand Down Expand Up @@ -211,6 +195,9 @@ module.exports = {
// unicorn
'unicorn/prefer-module': 'off',
'unicorn/filename-case': 'off',
'unicorn/no-negated-condition': 'off',
'unicorn/prefer-structured-clone': 'off',
'unicorn/switch-case-braces': 'off',
'unicorn/no-array-for-each': 'off', // this might be nice someday? better if it would do regular for loops for arrays
'unicorn/number-literal-case': 'off', // conflicts with prettier
'unicorn/no-nested-ternary': 'off', // conflicts with prettier
Expand All @@ -219,7 +206,8 @@ module.exports = {
'unicorn/prefer-spread': 'off', // possibly nice if we had native arrays
'unicorn/no-for-loop': 'off', // if for...of was good maybe we'd use this
'unicorn/better-regex': 'off', // would be awesome but has bugs https://github.com/sindresorhus/eslint-plugin-unicorn/issues?q=is%3Aissue+is%3Aopen+better-regex

'unicorn/no-anonymous-default-export': 'off',
'unicorn/prefer-node-protocol': 'off',
'unicorn/prefer-add-event-listener': 'error',
'unicorn/prefer-includes': 'error',
'unicorn/prefer-default-parameters': 'error',
Expand Down Expand Up @@ -301,12 +289,12 @@ module.exports = {
browser: false,
node: true,
},
plugins: ['node'],
extends: ['plugin:node/recommended'],
plugins: ['n'],
extends: ['plugin:n/recommended'],
rules: {
// this can be removed once the following is fixed
// https://github.com/mysticatea/eslint-plugin-node/issues/77
'node/no-unpublished-require': 'off',
'n/no-unpublished-require': 'off',
},
},
],
Expand Down
11 changes: 0 additions & 11 deletions .github/dependabot.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base"],
"labels": [":dependabot:", ":label: dependencies"],
"packageRules": [
{
"matchManagers": ["github-actions"],
"groupName": "github-actions"
}
],
"npm": {
"stabilityDays": 3
},
"rangeStrategy": "bump",
"prHourlyLimit": 10,
"vulnerabilityAlerts": {
"labels": [":label: security"],
"automerge": false,
"assignees": ["@runspired"],
"enabled": true
},
"ignorePaths": ["node_modules/**", "**/node_modules/**"]
}
39 changes: 20 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ on:
pull_request:
push:
branches:
- master
- main
- beta
- release
- 'release-*'
- 'lts-*'
tags:
- '*'

Expand All @@ -22,26 +17,32 @@ jobs:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
- uses: actions/setup-node@v4
with:
node-version: "16"
cache: "yarn"
- name: Yarn install
run: yarn --frozen-lockfile
- name: Lint js
run: yarn lint:js
registry-url: 'https://registry.npmjs.org'
node-version-file: 'package.json'
node-version: "18"
cache: "pnpm"
- name: Pnpm install
run: pnpm install
- name: Lint
run: pnpm lint

basic-tests:
name: Basic Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
- uses: actions/setup-node@v4
with:
node-version: "16"
cache: "yarn"
registry-url: 'https://registry.npmjs.org'
node-version-file: 'package.json'
node-version: "18"
cache: "pnpm"
- name: Install Dependencies
run: yarn install --frozen-lockfile
run: pnpm install
- name: Basic Development Tests
run: yarn test:development
run: pnpm test:development
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@
.eslintcache
/DEBUG
/packages/*/DEBUG
/.github/
/.sass-cache
/connect.lock
/coverage/*
/libpeerconnection.log
npm-debug.log*
yarn-error.log
testem.log

# ember-try
Expand Down
1 change: 1 addition & 0 deletions .prettier-cache

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
/coverage/
!.*
.eslintcache
pnpm-lock.yaml
/DEBUG
/packages/*/DEBUG
/.github/
Expand Down
21 changes: 0 additions & 21 deletions .prettierrc

This file was deleted.

36 changes: 36 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
module.exports = {
trailingComma: 'es5',
printWidth: 120,
plugins: ['prettier-plugin-ember-template-tag'],
overrides: [
{
files: '*.{js,ts,cjs,cts,mjs,mts}',
options: {
singleQuote: true,
},
},
{
files: '*.scss',
options: {
parser: 'scss',
trailingComma: 'none',
singleQuote: false,
},
},
{
files: ['*.hbs'],
options: {
singleQuote: false,
},
},
{
files: ['*.gjs', '*.gts'],
options: {
parser: 'ember-template-tag',
singleQuote: true,
templateSingleQuote: false,
trailingComma: 'es5',
},
},
],
};
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ Join the [Ember community on Discord](https://discord.gg/zT3asNS)

## Contributing

- Open an Issue for discussion first if you're unsure a feature/fix is wanted.
- Branch off of `main` (default branch)
- Use descriptive branch names (e.g. `<type>/<short-description>`)
- PR against `main` (default branch).
- Open an Issue for discussion first if you're unsure a feature/fix is wanted.
- Branch off of `main` (default branch)
- Use descriptive branch names (e.g. `<type>/<short-description>`)
- PR against `main` (default branch).

## Thanks

Expand Down
2 changes: 1 addition & 1 deletion jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"packages/*/dist",
"packages/*/tmp",
"packages/*/vendor",
".git",
".git"
]
}
21 changes: 8 additions & 13 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"packages": [
"packages/*"
],
"version": "3.0.0-alpha.0",
"command": {
"version": {
"allowBranch": [
"main",
"release"
]
}
"npmClient": "pnpm",
"useWorkspaces": true,
"packages": ["packages/*"],
"version": "3.0.0-alpha.0",
"command": {
"version": {
"allowBranch": ["main", "release"]
}
}
}
39 changes: 23 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,38 @@
}
],
"scripts": {
"lint": "pnpm run lint:prettier && pnpm run lint:js",
"lint:js": "eslint --cache --ext=js,ts .",
"lint:prettier": "prettier --check --cache --cache-location=.prettier-cache --log-level=warn .",
"lint:prettier:fix": "prettier --write --cache --cache-location=.prettier-cache --log-level=warn .",
"test:development": "lerna run --stream --parallel --no-private test:development"
},
"packageManager": "pnpm@9.12.3",
"volta": {
"node": "14.17.0",
"yarn": "1.22.4"
"node": "23.1.0",
"pnpm": "9.12.3"
},
"engines": {
"node": "12.* || 14.* || >= 16"
"node": "18.* || 20.* || >= 22",
"npm": "use pnpm",
"yarn": "use pnpm"
},
"devDependencies": {
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-proposal-decorators": "^7.17.2",
"eslint": "^8.10.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-ember": "^10.5.9",
"eslint-plugin-import": "^2.25.4",
"@babel/eslint-parser": "^7.25.9",
"@babel/plugin-proposal-decorators": "^7.25.9",
"eslint": "^8.57.1",
"prettier-plugin-ember-template-tag": "2.0.2",
"ember-template-tag": "2.3.16",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ember": "^12.3.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-no-useless-assign": "^1.0.3",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-qunit": "^7.2.0",
"eslint-plugin-simple-import-sort": "^7.0.0",
"eslint-plugin-unicorn": "^39.0.0",
"eslint-plugin-unused-imports": "^2.0.0",
"eslint-plugin-n": "^17.12.0",
"eslint-plugin-qunit": "^8.1.2",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-unicorn": "56.0.0",
"eslint-plugin-unused-imports": "^4.1.4",
"lerna": "^4.0.0",
"prettier": "^2.5.1"
"prettier": "^3.3.3"
}
}
2 changes: 1 addition & 1 deletion packages/flexi-config/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/ember-cli-build.js
/testem.js
/tests/
/yarn.lock
/pnpm-lock.yaml
.gitkeep

# ember-try
Expand Down
Loading
Loading