Skip to content

Commit

Permalink
Merge pull request #184 from extractus/4.0.4
Browse files Browse the repository at this point in the history
v4.0.4
  • Loading branch information
ndaidong authored Apr 26, 2024
2 parents ac1db60 + ee0509f commit cd08c33
Show file tree
Hide file tree
Showing 10 changed files with 301 additions and 139 deletions.
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

120 changes: 0 additions & 120 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node_version: [18.x, 20.x, 21.x]
node_version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v4
Expand Down
129 changes: 129 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
// eslint.config.js

import eslintjs from '@eslint/js'
import globals from 'globals'

export default [
eslintjs.configs.recommended,
{
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.node,
...globals.browser,
...globals.jest,
Intl: 'readonly',
},
},
ignores: [
'node_modules',
'storage',
'*.cjs',
],
rules: {
'arrow-spacing': ['error', { 'before': true, 'after': true }],
'block-spacing': ['error', 'always'],
'brace-style': ['error', '1tbs', { 'allowSingleLine': true }],
'camelcase': ['error', {
'allow': ['^UNSAFE_'],
'properties': 'never',
'ignoreGlobals': true,
}],
'comma-dangle': ['error', {
'arrays': 'always-multiline',
'objects': 'always-multiline',
'imports': 'never',
'exports': 'never',
'functions': 'never',
}],
'comma-spacing': ['error', { 'before': false, 'after': true }],
'eol-last': 'error',
'eqeqeq': ['error', 'always', { 'null': 'ignore' }],
'func-call-spacing': ['error', 'never'],
'indent': [
'error',
2,
{
'MemberExpression': 1,
'FunctionDeclaration': {
'body': 1,
'parameters': 2,
},
'SwitchCase': 1,
'ignoredNodes': ['TemplateLiteral > *'],
},
],
'key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }],
'keyword-spacing': ['error', { 'before': true, 'after': true }],
'lines-between-class-members': ['error', 'always', { 'exceptAfterSingleLine': true }],
'max-len': [
'error',
{
'code': 120,
'ignoreTrailingComments': true,
'ignoreComments': true,
'ignoreUrls': true,
},
],
'max-lines': [
'error',
{
'max': 500,
'skipBlankLines': true,
'skipComments': false,
},
],
'max-lines-per-function': [
'error',
{
'max': 200,
'skipBlankLines': true,
},
],
'max-params': ['error', 3],
'no-array-constructor': 'error',
'no-mixed-spaces-and-tabs': 'error',
'no-multi-spaces': 'error',
'no-multi-str': 'error',
'no-multiple-empty-lines': [
'error',
{
'max': 1,
'maxEOF': 0,
},
],
'no-restricted-syntax': [
'error',
'WithStatement',
'BinaryExpression[operator=\'in\']',
],
'no-trailing-spaces': 'error',
'no-use-before-define': [
'error',
{
'functions': true,
'classes': true,
'variables': false,
},
],
'no-var': 'warn',
'object-curly-spacing': ['error', 'always'],
'padded-blocks': [
'error',
{
'blocks': 'never',
'switches': 'never',
'classes': 'never',
},
],
'quotes': ['error', 'single'],
'space-before-blocks': ['error', 'always'],
'space-before-function-paren': ['error', 'always'],
'space-infix-ops': 'error',
'space-unary-ops': ['error', { 'words': true, 'nonwords': false }],
'space-in-parens': ['error', 'never'],
'semi': ['error', 'never'],
},
},
]
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "4.0.3",
"version": "4.0.4",
"name": "@extractus/oembed-extractor",
"description": "Get oEmbed data from given URL.",
"homepage": "https://github.com/extractus/oembed-extractor",
Expand Down Expand Up @@ -33,7 +33,8 @@
"cross-fetch": "^4.0.0"
},
"devDependencies": {
"eslint": "^8.57.0",
"eslint": "^9.1.1",
"globals": "^15.0.0",
"https-proxy-agent": "^7.0.4",
"jest": "^29.7.0",
"nock": "^13.5.4"
Expand Down
2 changes: 1 addition & 1 deletion src/utils/linker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const isValid = (url = '') => {
try {
const ourl = new URL(url)
return ourl !== null && ourl.protocol.startsWith('http')
} catch (err) {
} catch {
return false
}
}
Expand Down
27 changes: 26 additions & 1 deletion src/utils/providers.latest.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// provider data, synchronized at 2024-03-29T04:36:42.975Z
// provider data, synchronized at 2024-04-26T08:46:02.055Z

/* eslint-disable */

Expand Down Expand Up @@ -212,6 +212,12 @@ export const providers = [
],
"e": "blogcast.host/oembed"
},
{
"s": [
"bsky\\.app/profile/*/post/*"
],
"e": "embed.bsky.app/oembed"
},
{
"s": [
"www\\.bookingmood\\.com/embed/*/*"
Expand Down Expand Up @@ -1198,6 +1204,12 @@ export const providers = [
],
"e": "ndla.no/oembed"
},
{
"s": [
"*\\.neetorecord\\.com/watch/*"
],
"e": "api.neetorecord.com/api/v1/oembed"
},
{
"s": [
"*\\.nfb\\.ca/film/*"
Expand Down Expand Up @@ -1559,6 +1571,13 @@ export const providers = [
],
"e": "embed.sendtonews.com/services/oembed"
},
{
"s": [
"shopshare\\.tv/shopboard/*",
"shopshare\\.tv/shopcast/*"
],
"e": "shopshare.tv/api/shopcast/oembed"
},
{
"s": [
"www\\.shortnote\\.jp/view/notes/*"
Expand Down Expand Up @@ -1830,6 +1849,12 @@ export const providers = [
],
"e": "app-test.totango.com/oembed"
},
{
"s": [
"trackspace\\.upitup\\.com/*"
],
"e": "trackspace.upitup.com/oembed"
},
{
"s": [
"trinitymedia\\.ai/player/*",
Expand Down
Loading

0 comments on commit cd08c33

Please sign in to comment.