-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- also fixes for eslint 9 release - update eslint and node versions supported - use pnpm as primary package manager - exports are from dist because of build step
- Loading branch information
1 parent
15323fd
commit 6828add
Showing
55 changed files
with
803 additions
and
579 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,6 @@ package-lock.json | |
# Code Coverage | ||
.nyc_output/ | ||
coverage/ | ||
|
||
# Build | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
tasks: | ||
- init: npm install | ||
- init: pnpm install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<!DOCTYPE html> | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export type VersionAssertion = { | ||
type: 'tampermonkey' | 'violentmonkey' | 'greasemonkey'; | ||
versionConstraint: string; | ||
}; | ||
|
||
export type CompatMap = { | ||
[Key in string]?: VersionAssertion[]; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
'use strict'; | ||
|
||
import alignAttributes from './rules/align-attributes'; | ||
import betterUseMatch from './rules/better-use-match'; | ||
import compatGrant from './rules/compat-grant'; | ||
import compatHeaders from './rules/compat-headers'; | ||
import filenameUser from './rules/filename-user'; | ||
import metadataSpacing from './rules/metadata-spacing'; | ||
import noInvalidGrant from './rules/no-invalid-grant'; | ||
import noInvalidHeaders from './rules/no-invalid-headers'; | ||
import noInvalidMetadata from './rules/no-invalid-metadata'; | ||
import requireAttributeSpacePrefix from './rules/require-attribute-space-prefix'; | ||
import requireDescription from './rules/require-description'; | ||
import requireDownloadUrl from './rules/require-download-url'; | ||
import requireName from './rules/require-name'; | ||
import requireVersion from './rules/require-version'; | ||
import useHomepageAndUrl from './rules/use-homepage-and-url'; | ||
import type { ESLint } from 'eslint'; | ||
|
||
const rules = Object.fromEntries( | ||
Object.entries({ | ||
'align-attributes': alignAttributes, | ||
'better-use-match': betterUseMatch, | ||
'compat-grant': compatGrant, | ||
'compat-headers': compatHeaders, | ||
'filename-user': filenameUser, | ||
'metadata-spacing': metadataSpacing, | ||
'no-invalid-grant': noInvalidGrant, | ||
'no-invalid-headers': noInvalidHeaders, | ||
'no-invalid-metadata': noInvalidMetadata, | ||
'require-attribute-space-prefix': requireAttributeSpacePrefix, | ||
'require-description': requireDescription, | ||
'require-download-url': requireDownloadUrl, | ||
'require-name': requireName, | ||
'require-version': requireVersion, | ||
'use-homepage-and-url': useHomepageAndUrl | ||
}).map(([ruleName, ruleMeta]) => { | ||
return [ | ||
ruleName, | ||
{ | ||
...ruleMeta, | ||
meta: { | ||
...ruleMeta.meta, | ||
docs: { | ||
...ruleMeta.meta.docs, | ||
url: `https://yash-singh1.github.io/eslint-plugin-userscripts/#/rules/${ruleName}` | ||
} | ||
} | ||
} | ||
]; | ||
}) | ||
) satisfies ESLint.Plugin['rules']; | ||
|
||
const configs = { | ||
recommended: { | ||
plugins: ['userscripts'], | ||
rules: { | ||
'userscripts/filename-user': ['error', 'always'], | ||
'userscripts/no-invalid-metadata': ['error', { top: 'required' }], | ||
'userscripts/require-name': ['error', 'required'], | ||
'userscripts/require-description': ['error', 'required'], | ||
'userscripts/require-version': ['error', 'required'], | ||
'userscripts/require-attribute-space-prefix': 'error', | ||
'userscripts/use-homepage-and-url': 'error', | ||
'userscripts/require-download-url': 'error', | ||
'userscripts/align-attributes': ['error', 2], | ||
'userscripts/metadata-spacing': ['error', 'always'], | ||
'userscripts/no-invalid-headers': 'error', | ||
'userscripts/no-invalid-grant': 'error', | ||
'userscripts/compat-grant': 'off', | ||
'userscripts/compat-headers': 'off', | ||
'userscripts/better-use-match': 'warn' | ||
} | ||
} | ||
} satisfies ESLint.Plugin['configs']; | ||
|
||
export { rules, configs }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
lib/rules/better-use-match.js → lib/rules/better-use-match.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.