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
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Description

A brief overview of your completed or ongoing work.

### Developement Checklist

- [ ] Bump version up (`package.json` **and** `package-lock.json`)

### Preview(s)

- Add screenshots, gifs, videos, etc. here for a quick preview if applicable.
4 changes: 2 additions & 2 deletions .github/workflows/on-merge-main-deploy-gpr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://npm.pkg.github.com'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/on-merge-main-deploy-npmjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
deploy_npmjs_package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
verify_pull_request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Checkout 🛎️
run: npm ci

Expand Down
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,22 @@ Customization with optional inputs and icon

## Compatibility <a name="compatibility"></a>

| Angular version | @proangular/ngx-scroll-top | Status |
| --------------- | -------------------------- | ---------- |
| v19 | v19.0.0 | Compatible |
| v18 | ------ | Untested |
| v17 | ------ | Untested |
| v16 | ------ | Untested |
| v15 | ------ | Untested |
| v14 | v1.x.x | Compatible |
| v13 | v1.x.x | Compatible |
| v12 | v1.x.x | Compatible |
| <<<<<<< HEAD | Angular version | @proangular/ngx-scroll-top | Install | |
| ------------------------------------------- | --------------- | ----------------------------------------- | --------------- | ---------- | ---------- | ---------- | --- | ------ | -------- | --- |
| ------------------------------------------- | | v20 | v20.0.0 |
| `ng add @proangular/ngx-scroll-top@^20.0.0` | | v19 | v19.0.0 |
| `ng add @proangular/ngx-scroll-top@^19.0.0` | | v18 | ------ | Untested | | v17 |
| ------ | Untested | | v16 | ------ | Untested | | v15 | ------ | Untested | |
| v14 | v1.x.x | `ng add @proangular/ngx-scroll-top@1.1.8` | | v13 | v1.x.x |
| `ng add @proangular/ngx-scroll-top@1.1.8` | | v12 | v1.x.x |
| `ng add @proangular/ngx-scroll-top@1.1.8` | ======= | Angular version |
| @proangular/ngx-scroll-top | Status | | --------------- |
| -------------------------- | ---------- | | v19 | v19.0.0 | Compatible | | v18 |
| ------ | Untested | | v17 | ------ | Untested | | v16 | ------ | Untested | |
| v15 | ------ | Untested | | v14 | v1.x.x | Compatible | | v13 | v1.x.x |
| Compatible | | v12 | v1.x.x | Compatible |

> > > > > > > main

<p align="right">[ <a href="#index">Index</a> ]</p>

Expand Down
34 changes: 30 additions & 4 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:application",
"builder": "@angular/build:application",
"options": {
"outputPath": "dist/ngx-scroll-top",
"index": "src/index.html",
Expand Down Expand Up @@ -61,7 +61,7 @@
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"builder": "@angular/build:dev-server",
"configurations": {
"production": {
"buildTarget": "ngx-scroll-top:build:production"
Expand All @@ -73,10 +73,10 @@
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n"
"builder": "@angular/build:extract-i18n"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"builder": "@angular/build:karma",
"options": {
"polyfills": [
"zone.js",
Expand Down Expand Up @@ -112,5 +112,31 @@
"schematicCollections": [
"@angular-eslint/schematics"
]
},
"schematics": {
"@schematics/angular:component": {
"type": "component"
},
"@schematics/angular:directive": {
"type": "directive"
},
"@schematics/angular:service": {
"type": "service"
},
"@schematics/angular:guard": {
"typeSeparator": "."
},
"@schematics/angular:interceptor": {
"typeSeparator": "."
},
"@schematics/angular:module": {
"typeSeparator": "."
},
"@schematics/angular:pipe": {
"typeSeparator": "."
},
"@schematics/angular:resolver": {
"typeSeparator": "."
}
}
}
224 changes: 224 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
// @ts-check
const eslint = require('@eslint/js');
const tseslint = require('typescript-eslint');
const angular = require('angular-eslint');

module.exports = tseslint.config(
{
files: ['**/*.ts'],
extends: [
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
...angular.configs.tsRecommended,
],
processor: angular.processInlineTemplates,
rules: {
// Component selectors should follow given naming rules.
// @see http://codelyzer.com/rules/component-selector/
'@angular-eslint/component-selector': [
'error',
{
type: 'element',
prefix: 'ngx',
style: 'kebab-case',
},
],
// Directive selectors should follow given naming rules.
// @see http://codelyzer.com/rules/directive-selector/
'@angular-eslint/directive-selector': [
'error',
{
type: 'attribute',
prefix: 'ngx',
style: 'camelCase',
},
],
// Prefer to declare @Output as readonly since they are not supposed
// to be reassigned.
// @see http://codelyzer.com/rules/prefer-output-readonly/
'@angular-eslint/prefer-output-readonly': ['error'],
// Enforce use of component selector rules.
// @see http://codelyzer.com/rules/component-selector/
'@angular-eslint/use-component-selector': ['error'],
// Disallows using ViewEncapsulation.None.
// @see http://codelyzer.com/rules/use-component-view-encapsulation/
'@angular-eslint/use-component-view-encapsulation': ['error'],
// Ensure that components implement life cycle interfaces if they use
// them.
// @see http://codelyzer.com/rules/use-life-cycle-interface/
'@angular-eslint/use-lifecycle-interface': ['error'],
// Require consistently using either T[] or Array<T> for arrays.
// @see https://typescript-eslint.io/rules/array-type/
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
// Enforce consistent usage of type assertions.
// @see https://typescript-eslint.io/rules/consistent-type-assertions/
'@typescript-eslint/consistent-type-assertions': [
'error',
{
assertionStyle: 'as',
objectLiteralTypeAssertions: 'never',
},
],
// Enforce type definitions to consistently use either interface or type.
// @see https://typescript-eslint.io/rules/consistent-type-definitions/
'@typescript-eslint/consistent-type-definitions': 'error',
// Require explicit return types on functions and class methods.
// @see https://typescript-eslint.io/rules/explicit-function-return-type/
'@typescript-eslint/explicit-function-return-type': [
'error',
{ allowExpressions: true },
],
// Require explicit accessibility modifiers on class properties and methods.
// @see https://typescript-eslint.io/rules/explicit-member-accessibility/
'@typescript-eslint/explicit-member-accessibility': [
'error',
{ accessibility: 'explicit' },
],
// Require explicit return and argument types on exported functions' and
// classes' public class methods.
// @see https://typescript-eslint.io/rules/explicit-module-boundary-types/
'@typescript-eslint/explicit-module-boundary-types': 'error',
// Require a consistent member declaration order.
// @see https://typescript-eslint.io/rules/member-ordering/
'@typescript-eslint/member-ordering': [
'error',
{
default: [
'constructor',
'static-field',
'instance-field',
'static-method',
'instance-method',
],
},
],
// Enforce naming conventions for everything across a codebase.
// @see https://typescript-eslint.io/rules/naming-convention/
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'classProperty',
format: ['PascalCase', 'camelCase'],
modifiers: ['public'],
},
{
selector: 'function',
format: ['camelCase'],
},
{
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^I[A-Z]',
match: false,
},
},
{
selector: 'enumMember',
format: ['UPPER_CASE'],
},
],
// Disallow empty functions.
// @see https://typescript-eslint.io/rules/no-empty-function/
'@typescript-eslint/no-empty-function': 'error',
// Disallow the declaration of empty interfaces.
// @see https://typescript-eslint.io/rules/no-empty-interface/
'@typescript-eslint/no-empty-interface': 'off',
// Disallow the any type.
// @see https://typescript-eslint.io/rules/no-explicit-any/
'@typescript-eslint/no-explicit-any': 'error',
// Disallow TypeScript namespaces.
// @see https://typescript-eslint.io/rules/no-namespace/
'@typescript-eslint/no-namespace': ['error', { allowDeclarations: true }],
// Disallow unused expressions.
// @see https://typescript-eslint.io/rules/no-unused-expressions/
'@typescript-eslint/no-unused-expressions': 'error',
// Disallow unused variables.
// @see https://typescript-eslint.io/rules/no-unused-vars/
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
ignoreRestSiblings: true,
varsIgnorePattern: '^_',
},
],
// Enforce the use of for-of loop over the standard for loop where
// possible.
// @see https://typescript-eslint.io/rules/prefer-for-of/
'@typescript-eslint/prefer-for-of': ['warn'],
// Enforce using function types instead of interfaces with call
// signatures.
// @see https://typescript-eslint.io/rules/prefer-function-type/
'@typescript-eslint/prefer-function-type': ['warn'],
// Disallow two overloads that could be unified into one with a union
// or an optional/rest parameter.
// @see https://typescript-eslint.io/rules/unified-signatures/
'@typescript-eslint/unified-signatures': 'warn',
// Require the use of === and !==
// @see https://eslint.org/docs/latest/rules/eqeqeq
eqeqeq: ['error'],
// Require for-in loops to include an if statement
// @see https://eslint.org/docs/latest/rules/guard-for-in
'guard-for-in': ['error'],
// Disallow bitwise operators
// @see https://eslint.org/docs/latest/rules/no-bitwise
'no-bitwise': ['error'],
// Disallow the use of arguments.caller or arguments.callee
// @see https://eslint.org/docs/latest/rules/no-caller
'no-caller': ['error'],
// Disallow the use of console
// @see https://eslint.org/docs/latest/rules/no-console
'no-console': ['error', { allow: ['warn', 'error'] }],
// Disallow duplicate module imports
// @see https://eslint.org/docs/latest/rules/no-duplicate-imports
'no-duplicate-imports': ['error'],
// Disallow empty block statements
// @see https://eslint.org/docs/latest/rules/no-empty
'no-empty': 'error',
// Disallow the use of eval()
// @see https://eslint.org/docs/latest/rules/no-eval
'no-eval': ['error'],
// Disallow new operators with the String, Number, and Boolean objects
// @see https://eslint.org/docs/latest/rules/no-new-wrappers
'no-new-wrappers': ['error'],
// Disallow throwing literals as exceptions
// @see https://eslint.org/docs/latest/rules/no-throw-literal
'no-throw-literal': ['error'],
// Require let or const instead of var
// @see https://eslint.org/docs/latest/rules/no-var
'no-var': ['error'],
// Require or disallow method and property shorthand syntax for object
// literals
// @see https://eslint.org/docs/latest/rules/object-shorthand
'object-shorthand': ['error'],
// Enforce variables to be declared either together or separately in
// functions
// @see https://eslint.org/docs/latest/rules/one-var
'one-var': ['error', 'never'],
// Require using arrow functions for callbacks
// @see https://eslint.org/docs/latest/rules/prefer-arrow-callback
'prefer-arrow/prefer-arrow-functions': 'off',
// Require const declarations for variables that are never reassigned
// after declared
// @see https://eslint.org/docs/latest/rules/prefer-const
'prefer-const': ['error'],
// Enforce the consistent use of the radix argument when using
// parseInt()
// @see https://eslint.org/docs/latest/rules/radix
radix: ['error'],
// Enforce consistent spacing after the // or /* in a comment
// @see https://eslint.org/docs/latest/rules/spaced-comment
'spaced-comment': ['error', 'always', { block: { balanced: true } }],
},
},
{
files: ['**/*.html'],
extends: [
...angular.configs.templateRecommended,
...angular.configs.templateAccessibility,
],
rules: {},
},
);
Loading